home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / flashdoc.lzh / SECRETS.TXT < prev    next >
Text File  |  1992-02-21  |  119KB  |  4,527 lines

  1.  
  2.  
  3.  
  4. .____________________________________________________.
  5. |                                                    |
  6. |  S  E  C  R  E  T  S      O  F      F  L  A  S  H  |
  7. |                                                    |
  8. \====================================================/
  9.  
  10.  
  11.  How to make the most of Flash's DO language:
  12.  Things they never seem to tell you at the store.
  13.  
  14.  
  15.  
  16.  
  17.  _________________________
  18.  
  19.  B Y   A L   F A S O L D T
  20.  
  21.  -------------------------
  22.  
  23.  
  24.  
  25. Technology Writer, Syracuse Newspapers and Newhouse News Service
  26.  
  27. Computer pagination trainer and programmer, the Herald-Journal,
  28. the Herald American and the Post-Standard
  29.  
  30. Syracuse, New York
  31.  
  32.  
  33.  
  34. Copyright (C) 1992 by Al Fasoldt. All rights reserved.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. P A R T   1 :   I N T R O D U C T I O N
  42. ---------------------------------------
  43.  
  44.  
  45.  
  46. This article is for newcomers and experienced Flash users 
  47. alike. Many parts of this guide contain information that may not
  48. be generally known to most users.
  49.  
  50. Flash was distributed by Antic Software, a company that is no 
  51. longer doing business. However, Flash is still available from ST 
  52. and TT software outlets.
  53.  
  54. Many of these tips may also be applicable for users of Flash II, 
  55. a new telecommunications program from Missionware. Flash II was 
  56. scheduled to be released by mid-1992.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. P A R T   2 :   W H A T   T H I S   I S   A L L   A B O U T
  64. -----------------------------------------------------------
  65.  
  66.  
  67.  
  68. Flash, a telecommunications program for the Atari ST, was 
  69. distributed by Antic Publishing's software division from the
  70. mid-1980s until the company ceased operation recently. Flash is
  71. now an orphan in the marketplace, although the copyright law in
  72. the United States and elsewhere still protects the software from
  73. infringement. Without direct manufacturer support, however, the
  74. only way Flash users can receive help is through the individual
  75. efforts of experienced Flash programmers who are willing to take
  76. the time to offer advice and assistance. One avenue for such
  77. help is the nationwide network of telecommunications services.
  78. These services, which include GEnie, Compuserve, BIX, Delphi and
  79. America Online, have active ST users who have used Flash for
  80. five or six years. Many of them have written extensive Flash
  81. scripts that take advantage of Flash's powerful programming
  82. language.
  83.  
  84. As one of those Flash programmers, I am offering this expanded 
  85. documentation as a means of keeping the thousands of current 
  86. Flash users up-to-date on how to use Flash's DO language -- its
  87. scripting commands -- in ways that may not be obvious in Flash's
  88. original, sparse documentation. This document is free, and I
  89. encourage you to share it in electronic or printed form with
  90. anyone else. But in doing so you must observe these three
  91. common-sense requirements:
  92.  
  93. 1. This document cannot be distributed in any altered form. 
  94. This means you must not make excerpts of it, and you must not
  95. remove the author's name and copyright notice.
  96.  
  97. 2. This document must not be distributed with any other 
  98. document or software program, other than the author's Flash DO
  99. files and any other support files that are archived with this
  100. text file. This means you must not include Flash itself with
  101. this documentation if you share it with anyone else.
  102.  
  103. 3. The author cannot be responsible for the use or misuse of 
  104. any of the files included with this documentation. This means
  105. you are on your own when you try out the DO files and the
  106. support program(s), and cannot blame me if any of them cause a
  107. problem.
  108.  
  109. If you have suggestions or comments, or would like your own DO 
  110. files or support programs included in revisions of this archive,
  111. you can reach me at any of these addresses:
  112.  
  113. Email:
  114.  
  115. GEnie - "a.fasoldt"; BIX - "afasoldt"; AOL - "Al Fasoldt"
  116.  
  117. U.S. mail - Syracuse Newspapers, Box 4915, Syracuse, NY 13221
  118.  
  119.  
  120.  
  121. ** A note about Flash versions **
  122.  
  123. The last release of Flash was Version 1.61. However, this 
  124. version is usually referred to as Version 1.6. According to the
  125. authors of Flash, Version 1.6 was never actually released, and
  126. all versions that carry a "1.6" designation are actually 1.61.
  127. This documentation is intended for users of 1.6/1.61 only, since
  128. the script language was made more powerful in that release. If
  129. you own an earlier version of Flash, an upgrade to 1.6/1.61 is
  130. highly recommended. A patch file distributed free on many
  131. telecomm services will automatically upgrade previous versions
  132. to the last version.
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. P A R T   3 :   W H A T   A R E   S C R I P T S   A N Y W A Y ?
  140. ---------------------------------------------------------------
  141.  
  142.  
  143. ** Scripts tell the computer what to do **
  144.  
  145. Many telecommunications programs have built-in scripting 
  146. abilities. In other words, they are able to follow a written
  147. list of instructions much like the scripts that actors must
  148. follow. A telecomm script, like the ones used in plays and
  149. movies, contains lines that must be said (or sent to another
  150. computer, in the case of the telecomm script), and it may
  151. contain such things as cues, also. (The computer may be told to
  152. wait until a certain time has passed before it does something
  153. else, for example.)
  154.  
  155. But telecomm scripts usually have many more features than this. 
  156. The scripting facility built into Flash, called the "DO"
  157. language, can instruct the computer to perform any of these
  158. functions:
  159.  
  160.  - Suspend action until a specific time
  161.  
  162.  - Wait to get an exact word or phrase from the other computer 
  163. before proceeding
  164.  
  165.  - Show a dialog box on the screen and ask for user input
  166.  
  167.  - Ring the computer's bell (and even ring the bell on the other 
  168. computer)
  169.  
  170.  - Dial a number and redial it up to 99 times if it's busy
  171.  
  172.  - Delete a file on a disk drive
  173.  
  174.  - Check to see if a particular file exists
  175.  
  176.  - Check the contents of any file, line-by-line
  177.  
  178.  - Run a program
  179.  
  180.  - Program and execute a function key remotely
  181.  
  182.  - Check to see if an upload or download was successful and try 
  183. it again, if desired
  184.  
  185.  - Look back to see what the last information the other 
  186. computer sent actually said
  187.  
  188.  
  189. And much more -- so much more, in fact, that many casual Flash 
  190. users are unaware of the full power of the DO language. For
  191. example, a DO script can assemble a text file from information
  192. that is sent across from another computer and save that text
  193. with the date as part of the name. For another example, a DO
  194. script can even modify itself by creating a new DO file and then
  195. running it.
  196.  
  197. You'll see how to do all of this and more in this 
  198. documentation. But first, we'll need to understand the basic way
  199. a DO script is put together.
  200.  
  201.  
  202.  
  203.  
  204. ** A note on the way commands and keystrokes are shown **
  205.  
  206. Keyboard keys are listed in the text with angle brackets before 
  207. and after them, like this:
  208.  
  209.  <tab>.
  210.  
  211.  
  212. Key combinations are shown the same way, with a hyphen between 
  213. them, like this:
  214.  
  215.  <control-C>.
  216.  
  217.  
  218. Many commands are not complete without parameters. In simple 
  219. terms, parameters make a command more specific. The place where 
  220. parameters go is shown like this:
  221.  
  222.  [...]
  223.  
  224.  
  225. Quotation marks are sometimes used to set off parts of the 
  226. text, like this:
  227.  
  228.  A ".DO" file extender.
  229.  
  230.  
  231. Do NOT type the quotes when you follow the example.
  232.  
  233. However, quotation marks are also used within DO scripts for 
  234. various purposes. Whenever an example of quotes within a DO
  235. script is given, you will see a reminder that the quotation 
  236. marks MUST be included in the script.
  237.  
  238. Finally, grammarians who are reading this carefully may notice 
  239. that this text breaks the rules of punctuations freely.  
  240. Whenever this is done, it's for clarity. (If you're wondering
  241. what I am referring to, here's an example. In DO script writing,
  242. we use ">". The period probably should have gone inside the
  243. quotation marks -- like this: ">." -- but that would make the
  244. example a lot harder to follow.)
  245.  
  246.  
  247.  
  248.  
  249. A note on the way pathnames are shown
  250. -------------------------------------
  251.  
  252.  
  253. By convention, filenames that are listed in the parameters 
  254. sections of this document have the name "filename.ext"; drives
  255. are listed as "d:" -- with the colon included as part of the
  256. required drive specifier. The "d:" does not stand for any
  257. particular drive; it can be "a:" through "p:" on some STs and 
  258. TTs and "a:" through "z:" on others.
  259.  
  260. The ST and TT operating system uses a common method of 
  261. indicating which command parameters are pathways (drives and
  262. folders) and which are files. Pathways can be relative or
  263. absolute, depending on how they are written. An absolute pathway
  264. always has a backslash at the end, whether a filename follows it
  265. or not. A relative pathway does not have a slash after it. And
  266. files, in turn, never have slashes after their names.
  267.  
  268. Here are some simple examples:
  269.  
  270. An absolute pathname:
  271.  
  272.  c:\flash\dofiles\
  273.  
  274. This indicates that Flash should perform some operation in the 
  275. folder named "dofiles" inside another folder named "flash" in
  276. the root directory of the c: drive.
  277.  
  278. A relative pathname:
  279.  
  280.  c:
  281.  
  282. This indicates that Flash should perform some operation in 
  283. whatever pathway it was already using on the c: drive. It may
  284. seem obvious to some that the "c:" could be left out, but this
  285. is not necessarily the case. For example, if Flash's default
  286. pathway had been "c:\flash\" and was then changed to
  287. "a:\messages\", any time Flash returns to "c:" (without a
  288. backslash) it will arrive at the location it was in the last
  289. time it accessed the "c:" drive.
  290.  
  291. A pathname and filename:
  292.  
  293.  c:\flash\dofiles\callbbs.do
  294.  
  295. NOTE: You must be sure to include the backslash between 
  296. "dofiles" and "callbbs.do" so that the operating system does not
  297. look for a file named "dofiles" in the "c:\flash\" directory.
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304. P A R T   3 :   H O W   S C R I P T S   A R E   W R I T T E N
  305. -------------------------------------------------------------
  306.  
  307.  
  308.  
  309.  
  310. Here are guidelines for writing and executing scripts. All of 
  311. them are explained in detail later.
  312.  
  313.  
  314. In Flash DO scripts, commands should be:
  315.  
  316. 1. Written in plain text, also called ASCII.
  317.  
  318. 2. Written on a separate line -- until the script has been 
  319. tested and is known to work properly. You then have the option
  320. of combining many commands on one line.
  321.  
  322. 3. Preceded by a ">" character.
  323.  
  324. 4. Followed by a "|" character.
  325.  
  326. 5. Written with comments at the beginning giving the name of the
  327. script and at any point in the script where complicated commands
  328. are operating.
  329.  
  330. 6. Written in lower case.
  331.  
  332.  
  333.  
  334. Flash DO scripts can be:
  335.  
  336. 1. Any practical length (although short scripts execute faster
  337. than long ones).
  338.  
  339. 2. Named anything you want, with any choice of filename 
  340. extender -- although you should standardize the extenders to
  341. make scripts easy to organize.
  342.  
  343. 3. Executed from any folder or from a root directory on a 
  344. floppy disk, hard disk or ramdisk.
  345.  
  346.  
  347.  
  348. Flash scripts can be executed in five ways:
  349.  
  350. 1. From Flash's command line, which is accessed from the 
  351. terminal screen by pressing the <insert> key.
  352.  
  353. 2. From an alt-key combination.
  354.  
  355. 3. From a function key.
  356.  
  357. 4 From another script.
  358.  
  359. 5. From Flash itself, automatically, whenever Flash runs.
  360.  
  361.  
  362.  
  363.  
  364. ** The write of passage **
  365.  
  366.  
  367. Flash scripts must be written in plain text.
  368. -------------------------------------------
  369.  
  370. Word processors usually store their text files in a form that 
  371. includes codes for such things as boldface, font sizes, line 
  372. centering and other display attributes. While this is perfectly 
  373. fine for documents that are printed out, it causes a great deal
  374. of trouble for texts that are used as script files. These texts
  375. must not have any word-processing codes at all; if they do, the
  376. program running the script will either stop running the script
  377. or, in one of the favorite phrases of programmers, will "do
  378. something unpredictable."
  379.  
  380. The easiest way to make sure this doesn't happen is to write 
  381. Flash scripts by using Flash's own text editor. The Flash text
  382. editor is powerful enough to serve as a primary text editor for
  383. all script writing, although it does lack many of the niceties
  384. of the current standard text editor for the ST, STeno, from
  385. Gribnif Software. (The screen fonts can be made large or small
  386. in STeno, for example, and -- best of all -- STeno can be run as
  387. a GEM desk accessory while you are running Flash.)
  388.  
  389. But Flash's own text editor is ideal if you do not own STeno. 
  390. Flash's editor offers search-and-replace functions, block-delete
  391. and block-save operations, text-file insert, easy scrolling by
  392. the cursor keys or GEM window bars, and two big advantages --
  393. immediate access to Flash's GEM-bar menus, including the Help
  394. menu, and the ability to test a script as you are writing it.
  395.  
  396. No matter which text editor you use, you must turn off word 
  397. wrap before you write or load a script file. You do not want the
  398. text editor to decide where lines end; it probably will wrap
  399. some lines around and ruin the script. Flash's editor can load
  400. texts with inordinate line lengths (STWriter files, for example,
  401. can have line lengths of hundreds or even thousands of
  402. characters), but Flash itself runs into difficulties if scripts
  403. include lines that are longer than 102 characters. This means
  404. that you can write scripts with line lengths of, for example, 90
  405. columns (a "column" in text processor terminology contains one
  406. character), but unless you are careful you may have a problem
  407. making sense of your scripts if they are written that way; since
  408. Flash's editor will not show any characters past the 76th column
  409. without horizontal scrolling, you may forget that some lines
  410. extend past the right edge of the screen when you are checking
  411. your scripts. Play it safe and keep your line lengths down to 65
  412. to 75 columns.
  413.  
  414. Both STeno and Flash's own editor save texts in ASCII. The word 
  415. stands for the American Standard Code for Information 
  416. Interchange, and represents a set of standards that nearly all
  417. personal-computer manufacturers follow for the internal codes
  418. that are used for all regular keyboard characters. In other
  419. words, the letter "A" has the same ASCII code -- "10" in decimal
  420. notation -- on the ST, an IBM PC, or even an AT&T
  421. teletypewriter. (The ASCII standard also defines the common
  422. codes for such "characters" as <control-C> and <control-L>, 
  423. which normally cannot be seen on a computer screen because they 
  424. usually signal the computer to do certain things. However, both 
  425. STeno and Flash's own editor allow you to enter control
  426. characters directly into a script.)
  427.  
  428. However, if for some reason you would rather write Flash 
  429. scripts on a word processor, such as WordPerfect, WordUp, That's
  430. Write, WordFlair, WordWriter, 1st Word or STWriter, you will
  431. have to make sure you save the scripts to disk as ASCII files.
  432. Some word processors have an ASCII Save option and others can
  433. only save files as ASCII when they are "printed" to a disk file.
  434. If you choose this method, be sure to set the left margin at "0"
  435. and the right margin at about 75, and, if necessary, set top and
  436. bottom margins to "0" also. Then, after you have saved the
  437. scripts as ASCII files, run Flash and load them, one by one,
  438. into Flash's text editor and look them over carefully. (Turn 
  439. off Flash's word wrap whenever you do this.) Then save them 
  440. again from within Flash.
  441.  
  442. (A big drawback to using a word processor for writing scripts 
  443. is that the word processor is not likely to let you insert
  444. control characters in the text that it saves as ASCII. The
  445. typical exception is <control-I>, which has no use in most
  446. script files anyway. And if this isn't enough of a reason to
  447. avoid a word processor when writing scripts, there's the added
  448. trouble of reconverting ASCII-based scripts back to your
  449. favorite word processor's format whenever you want to edit them.
  450. My advice: Use STeno or Flash's own editor.)
  451.  
  452.  
  453.  
  454. Scripts should be written with each command on a separate line.
  455. ---------------------------------------------------------------
  456.  
  457.  
  458. Scripts are written in a kind of code that looks like English 
  459. words or abbreviations. Until you become an expert at script
  460. writing and script editing, you should always write each command
  461. on a line of its own. This makes the task of debugging a script
  462. much easier, since you'll have a lot better chance of
  463. understanding what each command is trying to do when they're
  464. separated.
  465.  
  466. Flash does not require each command to be on a separate line, 
  467. however. It will run scripts without a problem if commands are 
  468. bunched up. In fact, scripts will run slightly faster that way.
  469. (Technically, the reason is that Flash parses or interprets
  470. scripts one line at a time when they are run, and it will parse
  471. a few long lines faster than a lot of short ones.) But until you
  472. are entirely comfortable with the way each command works, you're
  473. better off keeping them on separate lines.
  474.  
  475.  
  476.  
  477. Commands must be preceded by a ">" character.
  478. ---------------------------------------------
  479.  
  480.  
  481. Commands must have a right-facing angle bracket in front of 
  482. them. (You don't have to put the angle bracket right next to the
  483. command; you can put spaces between them if you want. For more
  484. on this technique, see Appendix XX, "Making scripts more
  485. readable.")
  486.  
  487. The angle bracket, also called the "greater-than" symbol, is 
  488. the only way Flash can tell that the word that follows the
  489. bracket is an actual command.  The ">" character should be
  490. considered as part of every Flash command, even if commands are
  491. bunched up on a single line. Every time Flash sees an angle
  492. bracket, it expects that the next characters it sees will be a
  493. command. (Flash will ignore that bracket and any of the other 
  494. special characters used in scripts if they are enclosed in 
  495. quotes, however.)
  496.  
  497.  
  498.  
  499. Commands must end with a "|" character.
  500. ---------------------------------------
  501.  
  502.  
  503. Once Flash encounters a ">" character in a script, it accepts 
  504. all the characters EXCEPT SPACES following the ">" as parts of a
  505. command until it comes to a vertical bar symbol. The "|" symbol
  506. is shown on the ST keyboard, in typical IBM fashion, as two
  507. short vertical bars, one on top of the other. (You get it by
  508. typing <shift-\>.)
  509.  
  510. The vertical bar symbol has a double job in Flash. It also 
  511. stands for a carriage-return/line-feed combination -- a
  512. <return>, in other words. We'll see how Flash uses "|" for just
  513. a <cr/lf> later.
  514.  
  515.  
  516.  
  517. Commands should be commented.
  518. -----------------------------
  519.  
  520.  
  521. A comment in a programming language is any part of the script 
  522. that is ignored when the script is run. In Flash, a comment is
  523. indicated by two asterisks placed right after a ">" symbol. At
  524. the end of each comment, Flash requires a "|" symbol. A typical
  525. comment might look like this:
  526.  
  527.  >** This is the start of the CALLBBS routine.|
  528.  
  529.  
  530. Comments can be any reasonable length. Even though it seems 
  531. obvious that comments should be self-contained on one line, this
  532. is not the case at all. Flash considers any length of text a
  533. comment if it starts with a ">" and ends with a "|". This means
  534. that entire paragraphs or groups of paragraphs can be comments.
  535. (In testing, I used a text more than 180K long as a comment,
  536. without a problem ...  except, of course, for the dreadful
  537. slowdown in the execution of the script.)
  538.  
  539. This unusual property allows programmers to treat comments as 
  540. blocks of text, readily set off from the main sections of the
  541. script. Comments could look like this:
  542.  
  543.  
  544. >**
  545.  
  546. This part of the script calls the Zork BBS and waits for 2 
  547. minutes for an acceptable connection. If it does not find one, it
  548. calls back 15 minutes later.
  549.  
  550. |
  551.  
  552.  
  553.  
  554. Note that both the start-comment and end-comment command 
  555. characters -- ">**" and "|" -- were on lines of their own. This
  556. may seem unorthodox, but works fine. It is especially easy to
  557. read the comment, since it does not have any asterisks or
  558. vertical-bar symbols as part of the comment text.
  559.  
  560. Experienced programmers always place comments in their work; 
  561. they have no choice, because the alternative would be to trust
  562. everything to memory. Commented commands and subroutines are
  563. also a sign that the programmer knew what he or she was doing.
  564. Many veteran Flash users have seen scripts that performed
  565. complicated tasks in needlessly serpentine ways, largely because
  566. the script writer had gotten lost deep within the script and had
  567. to wiggle within the commands to get back out. Scripts that are
  568. commented can help avoid this, and as a result the scripts will
  569. be more powerful and usually will run faster.
  570.  
  571. Remember that comments slow down the execution speed of DO 
  572. scripts. Even though Flash does not treat anything within a
  573. comment as a command, Flash looks through all comments for
  574. improper command syntax. (This is bizarre, to say the least, but
  575. it cannot be avoided.) Flash will not allow unpaired quotation
  576. marks in comments, for example. This means you will not be able
  577. to use contractions in comments unless you spell them with
  578. double apostrophes -- like this:  "Don''t use single 
  579. apostrophes; Flash can''t execute the DO script otherwise." If
  580. this looks as silly to you as it does to me, just avoid
  581. unnecessary contractions, apostrophes and quotation marks 
  582. altogether in DO files.
  583.  
  584.  
  585.  
  586. Commands should be written in lower case.
  587. -----------------------------------------
  588.  
  589.  
  590. Some scripting languages require upper-case commands, and some 
  591. require lower-case commands. Flash can accept them either way, 
  592. so you'll probably find that lower-case entries are better
  593. because they are easier to read. Two exceptions are any
  594. single-letter variable names, which in Flash are indicated by a
  595. dollar-sign symbol followed by a letter from A to Z and which
  596. can be confusing in lower case, and the Flash command for a
  597. label, "L", which can be misidentified as the number "1" if it
  598. is written in lower case.
  599.  
  600.  
  601.  
  602.  
  603. ** The play's the thing **
  604.  
  605.  
  606. Scripts can be any practical length.
  607. ------------------------------------
  608.  
  609.  
  610. You will not find a limit to DO file lengths in any normal use. 
  611. My tests have shown that scripts longer than 100K caused no
  612. problem other than a severe slowdown in execution. If you write
  613. a very long script that seems to take a few minutes to load and
  614. run, try breaking the script into a couple of parts and running
  615. those parts from a master script.
  616.  
  617.  
  618.  
  619. Scripts can have any name you want.
  620. -----------------------------------
  621.  
  622.  
  623. Alan Page, co-creator of Flash, began the convention of naming 
  624. scripts with a ".DO" extender. (A filename extender follows the 
  625. period at the end of the filename and can be one to three 
  626. characters long.) But there's nothing that prevents you from
  627. using any other extender or, of course, no extender at all.
  628. Flash will run any DO file regardless of its name. But you'll
  629. find it a lot easier to keep track of your scripts if they all
  630. have the same filename extender, whether it is ".DO" or ".SCR"
  631. or something else. I suggest the conservative course of sticking
  632. to "filename.do" to avoid confusion, since no other programs for
  633. the ST currently use the ".DO" extender.
  634.  
  635.  
  636.  
  637. Scripts can be stored and run from any folder or path.
  638. ------------------------------------------------------
  639.  
  640.  
  641. In its default state, without any prior modification of its 
  642. file paths, Flash expects to find scripts in the same folder or
  643. path that it was run from. However, you can specify any other
  644. location when you run a DO script, or you can change the default
  645. directory through a "cd" (change directory) command within a
  646. script. You can also issue the "cd" command from Flash's command
  647. line, a function key or the GEM menu bar in Flash. You can even
  648. use a special script to search all possible paths for DO files
  649. automatically, letting it set the default once it has found the
  650. files.
  651.  
  652.  
  653.  
  654.  
  655. ** Running in place **
  656.  
  657.  
  658. Run a script from the command line.
  659. --------------------------------------
  660.  
  661.  
  662. The usual way of running a DO file is to use Flash's command 
  663. line. The command line appears at the bottom of the terminal
  664. screen (not the GEM window screen) any time you press the
  665. <insert> key. When the command line appears, type "do" and a
  666. space and then the full name of the script -- with the pathname
  667. preceding it, if necessary --  and then press <return>.
  668.  
  669.  
  670.  
  671. Run a script by pressing <alt-A>.
  672. ---------------------------------
  673.  
  674.  
  675. From Flash's terminal screen, you can press <alt-A> to open a 
  676. file selector from which to choose a DO script. Double-click on
  677. the script you want and it will execute.
  678.  
  679.  
  680.  
  681. Run a script from a function key.
  682. ---------------------------------
  683.  
  684.  
  685. Using Flash's function-key editor, you can program a function 
  686. key to run a script. Type the same command into the function key
  687. template that you would type at the command line. Make sure the
  688. function key command ends with a "|" symbol, which is Flash's
  689. equivalent of a <return> key, or the script will not execute.
  690. (Flash waits for you to press <return> in that case.)
  691.  
  692. Note that function keys are quite powerful. They can be 
  693. programmed from within a script, and can even be used within
  694. scripts as "gosubs."
  695.  
  696.  
  697.  
  698. Run a script from another script.
  699. ---------------------------------
  700.  
  701.  
  702. This is so obvious that it may be missed by some users: Flash's 
  703. scripts can be chained or nested. This offers a particular 
  704. advantage to a programmer, since scripts can be broken up into
  705. easy-to-write sections and run separately. Ideally, a master
  706. script should be written to run sub-scripts, as will be
  707. explained in some detail later.
  708.  
  709. The Flash command to run a DO script within another script 
  710. looks like this:
  711.  
  712.  >do pathname\filename.do|
  713.  
  714.  
  715.  
  716. Run a script automatically when Flash boots
  717. -------------------------------------------
  718.  
  719.  
  720. Flash's "auto" function, which is perhaps the least known of 
  721. the program's main features, will instruct Flash to execute a
  722. single command when it is first run. This seems fairly limiting,
  723. but it is not -- if you make that single command the "DO"
  724. command, which runs a script. Since a DO script can contain any
  725. number of commands, there is no real limit on what Flash can do,
  726. automatically, when it boots up.
  727.  
  728. Setting up the "auto" function involves nothing more than 
  729. pressing the <insert> key from Flash's terminal screen, typing
  730. "auto," a space, the command you want executed on bootup, then
  731. <return>. You must then save Flash's configuration file to the
  732. filename "FLASH.CNF" -- the configuration file it always looks
  733. for and loads when it runs.
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740. P A R T   4 :  B A S I C   F L A S H   C O M M A N D S
  741. ------------------------------------------------------
  742.  
  743.  
  744.  
  745.  
  746. The abbreviated command name is listed as the primary one, with 
  747. the longer name, if any, listed in parentheses. While Flash
  748. often has two ways of giving a particular command -- "baud" and
  749. "ba," for example -- by convention, the short name is preferred.
  750. With the exception of "load," "log" and "ifin," Flash itself
  751. does not scan past the first two letters of a command name
  752. anyway.
  753.  
  754. Parameters, if any, should be placed after the command name. 
  755. Commands that take parameters are listed this way:
  756.  
  757.  >ba [...]
  758.  
  759. If parameters are optional, commands are listed this way:
  760.  
  761.  >mf [...optional]
  762.  
  763. Please note that in each case in which a variable can be 
  764. substituted for a parameter, more than one variable can be used
  765. if they are concatenated (combined without spaces between them).
  766. For example, if the variable $X contains the characters
  767. "filename" and the variable $Y contains the characters ".ext",
  768. you can give Flash the command "lo ca $X$Y" and it will
  769. understand it as "lo ca filename.ext".
  770.  
  771.  
  772.  
  773. The building blocks
  774. -------------------
  775.  
  776.  
  777. Many script commands help build the structure of a DO file. 
  778. They include labels, jumps and conditionals. Within the
  779. structure, variables can help keep the script from becoming
  780. top-heavy. These commands are presented first to point out ways
  781. to build your scripts as economically as possible.
  782.  
  783.  
  784.  
  785. - LABELS
  786.  
  787. Command:
  788.  
  789.  >L: [...] (label)
  790.  
  791. Action:
  792.  
  793. Marks a line in the script that can be quickly accessed through 
  794. a "jmp" command. Flash skips everything between its previous
  795. point in the script and the label, and begins its next execution
  796. at the line following the label. The label should be by itself
  797. but does not have to be. Labels can be as long as the width of
  798. the screen, but short labels are best. Labels must not include a
  799. space.
  800.  
  801. Parameter:
  802.  
  803.  labelname or label_name
  804.  
  805. (Can be written in upper or lower case or any mixture of the
  806. two, but Flash does differentiate between capital letters and
  807. lower-case letters when it looks for labels. This means
  808. "labelname" is not the same as "LabelName")
  809.  
  810. Examples:
  811.  
  812.  >L: BeginCall|
  813.  
  814.  >L: a_really_long_label_but_it_is_OK_if_it_has_no_spaces|
  815.  
  816.  
  817.  
  818. - JUMPS or GOTOS
  819.  
  820. Command:
  821.  
  822.  >jmp [...]
  823.  
  824. (also abbreviated "jm")
  825.  
  826. Action:
  827.  
  828. Forces the script to look for the label given as the
  829. parameter and then to execute the command following the label. It
  830. is a misconception that labels must be on lines by themselves;
  831. they do not need to be. (See one of the examples below.)
  832.  
  833. The parameter must be spelled exactly the same as the label,
  834. including upper- and lower-case letters.
  835.  
  836. Note: The "jmp" command works as a standard "goto" in scripting 
  837. languages, not as a "gosub." That is, command execution will 
  838. not return to the line following the "jmp" command. However,
  839. Flash has an undocumented "gosub" feature, explained in "How to
  840. use 'gosubs' in scripts" below.
  841.  
  842. Parameters:
  843.  
  844.  labelname
  845.  
  846. or
  847.  
  848.  label_name
  849.  
  850. Examples:
  851.  
  852.  >jmp BeginCall|
  853.  
  854.  >jmp a_really_long_label_but_it_is_OK_if_it_has_no_spaces|
  855.  
  856. Context examples:
  857.  
  858. >L: begin|
  859. >ifi $X "Yes" jmp end|
  860. >ifi $X "No jmp begin|
  861.  
  862. ...
  863.  
  864. >L: start|>wt 08:45:00|>do callbbs.do|>jmp start|
  865.  
  866.  
  867.  
  868. - VARIABLES
  869.  
  870. Command:
  871.  
  872.  $X [...]
  873.  
  874. Action:
  875.  
  876. Places a character string (any letters or characters) into a 
  877. storage area represented by "$A" through "$Z". This is the most
  878. simple of many ways variables can be set. The parameter does not
  879. have to be in quotation marks, although the special symbols ">"
  880. and "|" must be set off with single quotes if they are assigned
  881. to a variable. There is one other variable in Flash. It's "$!",
  882. which represents the contents of Flash's single-line input
  883. buffer (the area where incoming data is stored while it is being
  884. received from the modem). You can't assign your own character
  885. string to "$!", but otherwise it works like the other variables.
  886.  
  887. Parameters:
  888.  
  889.  [any letters or numbers; the limit is just over 100]
  890.  
  891.  $Y (any other variable)
  892.  
  893. Examples:
  894.  
  895.  >$X c:\download\clock.prg|
  896.  
  897.  >$X $Y|
  898.  
  899.  >$Z '>Hello|'|
  900.  
  901.  
  902. Context examples:
  903.  
  904.  
  905. ** Using a variable with an Xmodem upload command **
  906.  
  907. >$X a:\temp\browneye.spc|
  908. >ul xm $X|
  909. >**
  910. Sets X to a filepath and filename,
  911. then uploads that file.
  912. |
  913.  
  914.  
  915. ** Setting one variable from another and combining variables **
  916.  
  917. >$X c:\letters\|
  918. >$Y $X|
  919. >$Z tomother.txt|
  920. >ul xm $Y$Z|
  921. >**
  922. Sets X to a pathname and then sets Y to X.
  923. Sets Z to a filename, then combines Y and Z for the Xmodem
  924. upload parameter.
  925. |
  926.  
  927.  
  928. Regular variables and the buffer variable are covered in greater 
  929. detail below.
  930.  
  931.  
  932.  
  933. - COMMENTS or REMARKS
  934.  
  935. Command:
  936.  
  937.  >** [...]
  938.  
  939. Action:
  940.  
  941. Treats text following the "**" as a comment or a remark until 
  942. the next "|" is reached. Comments can be as lengthy as you want,
  943. but long comments slow down the script. Although Flash is
  944. supposed to ignore the text in a comment, it checks comment
  945. lines for command syntax and will show an error if it encounters
  946. a non-paired quotation mark (either a single-quote or a
  947. double-quote mark) within the comment. If you use contractions
  948. within comments, they must have double apostrophes.
  949.  
  950. Comments can be dressed up with tabs and internal spaces, and 
  951. they can be set off in their own text blocks.
  952.  
  953. Parameters:
  954.  
  955.  [any text]
  956.  
  957. Example:
  958.  
  959. >**
  960.  
  961. This is a comment. The text can start on its own line.
  962.  
  963. Blank lines are OK. The vertical bar symbol ("|") can be placed
  964. on its own line after the comments.
  965.  
  966. Note that if the bar is surrounded by quotes, Flash will not
  967. count it as an end-command character.
  968.  
  969. |
  970.  
  971.  
  972.  
  973. - SCRIPT EXECUTION
  974.  
  975. Command:
  976.  
  977.  >do [...]
  978.  
  979. (execute a script)
  980.  
  981. Action:
  982.  
  983. Run a script within another script. The nesting limit is three. 
  984. Be careful when running scripts from a master script, since you
  985. may exceed the nesting limit without realizing it.
  986.  
  987. The "do" command is one way that Flash provides the equivalent 
  988. of a "gosub" -- a command that branches to another set of
  989. instructions and then returns when the other instruction is
  990. finished. (The return takes effect at the next command from the
  991. one that called the sub-script.) You must give the full filename
  992. of the script; Flash will not run scripts with ".DO" extenders
  993. unless ".DO" is specified in the "filename.ext" parameter.
  994.  
  995. Parameters:
  996.  
  997.  c:\filepath\dofile.ext
  998.  
  999.  $X (any variable containing a filespec)
  1000.  
  1001. Example:
  1002.  
  1003.  >do callbbs.do|
  1004.  >do c:\flash\dofiles\settime.do|
  1005.  >do c:\flash\do\$P|
  1006.  
  1007. Context example:
  1008.  
  1009. ** Scripts that are run from a master script based on the day **
  1010.  
  1011.  
  1012. >L: top|
  1013. >do c:\flash\do\setday.do|
  1014. >ifi $D "Monday" do callbix.do|
  1015. >ifi $D "Monday" jmp cleanup|
  1016. >ifi $D "Tuesday" do callbbs.do|
  1017. >ifi $D "Tuesday" jmp cleanup|
  1018. >ifi $D "Wednesday" do getmail.do|
  1019. >ifi $D "Wednesday" jmp cleanup|
  1020. ...
  1021. >L: cleanup:
  1022. >do arcmsgs.do|
  1023. >wt 00:01:00|
  1024. >jmp top|
  1025.  
  1026.  
  1027.  
  1028.  
  1029.   
  1030. The setup
  1031. ---------
  1032.  
  1033.  
  1034. Some of the script commands deal only with communications port 
  1035. parameters. They are usually set only once for each session in 
  1036. which Flash is run.
  1037.  
  1038.  
  1039.  
  1040. - BAUD RATE
  1041.  
  1042. Command:
  1043.  
  1044.  >ba [...]|
  1045.  
  1046. (baud)
  1047.  
  1048. Action:
  1049.  
  1050. Sets the baud rate, known more accurately as the 
  1051. bits-per-second rate. Your modem must support the rate you
  1052. choose. If you are setting up a direct connection through a
  1053. null-modem cable, you may find text transfers falter at 9600 and
  1054. 19,200 bps.
  1055.  
  1056. Parameters:
  1057.  
  1058.  11 [110 bps]
  1059.  
  1060.  30 [300 bps]
  1061.  
  1062.  60 [600 bps]
  1063.  
  1064.  12 [1200 bps]
  1065.  
  1066.  24 [2400 bps]
  1067.  
  1068.  48 [4800 bps]
  1069.  
  1070.  96 [9600 bps]
  1071.  
  1072.  19 [19200 bps]
  1073.  
  1074.  $X [any variable containing a bps number]
  1075.  
  1076.  
  1077. Examples:
  1078.  
  1079.  >ba 2400|
  1080.  
  1081.  >ba $X|
  1082.  
  1083.  
  1084.  
  1085.  
  1086. - DIALING
  1087.  
  1088. Command:
  1089.  
  1090.  >di [...]
  1091.  
  1092. (dial)
  1093.  
  1094. Action:
  1095.  
  1096. Tells Flash to dial a number. If the "#" parameter is given, 
  1097. Flash dials the number following the pound sign. If a name is
  1098. listed as a parameter, Flash looks in the dialing directory for
  1099. the first name that matches the letters given in the parameter
  1100. and then dials the number listed for that entry.
  1101.  
  1102. Parameters:
  1103.  
  1104.  # (followed by a telephone number)
  1105.  
  1106.  "name" (a listing in the dialing directory; it can be 
  1107. abbreviated)
  1108.  
  1109. Examples:
  1110.  
  1111.  >di #123 456-7890|
  1112.  
  1113.  >di harry|
  1114.  
  1115.  
  1116.  
  1117. - DUPLEX
  1118.  
  1119. Command:
  1120.  
  1121.  >du [...]
  1122.  
  1123. (duplex)
  1124.  
  1125. Action:
  1126.  
  1127. Sets the echo to remote or local (full or half). This is 
  1128. loosely called full or half duplex, although the term is not
  1129. accurate. In remote echo (full duplex), what you see on your
  1130. screen comes from the other computer, even if it is what you are
  1131. typing. (The signal goes out to the other computer and is echoed
  1132. back to yours for display on your screen.) In local echo (half
  1133. duplex), the words you type are displayed by your own computer.
  1134.  
  1135. Parameters:
  1136.  
  1137.  fu (full)
  1138.  
  1139.  ha (half)
  1140.  
  1141. /  (a toggle, from full to half or vice versa)
  1142.  
  1143.  $X (any variable containing "full," "half" or "/")
  1144.  
  1145. Examples:
  1146.  
  1147. >du full|
  1148.  
  1149. >du /|
  1150.  
  1151. >du $X|
  1152.  
  1153.  
  1154.  
  1155.  
  1156. - ECHO
  1157.  
  1158. Command:
  1159.  
  1160.  >ec [...]
  1161.  
  1162. (echo)
  1163.  
  1164. Action:
  1165.  
  1166. Sets the echoplex, in which Flash can send back all characters 
  1167. received from the remote computer, regardless of the "duplex" 
  1168. setting. With echo set to "off," flash does not send any 
  1169. characters back.
  1170.  
  1171. Parameters:
  1172.  
  1173.  on
  1174.  
  1175.  of (off)
  1176.  
  1177. /  (a toggle, from on to off and vice versa)
  1178.  
  1179. $X (any variable containing "on," "off" or "/")
  1180.  
  1181. Examples:
  1182.  
  1183.  >ec on|
  1184.  
  1185.  >ec /|
  1186.  
  1187. >ec $X|
  1188.  
  1189.  
  1190.  
  1191. - HANGUP
  1192.  
  1193. Command:
  1194.  
  1195.  >hg
  1196.  
  1197. (hang up)
  1198.  
  1199. Action:
  1200.  
  1201. Hangs up on the other modem or on the dead line.
  1202.  
  1203. Parameters:
  1204.  
  1205.  none
  1206.  
  1207. Example:
  1208.  
  1209.  >hg|
  1210.  
  1211.  
  1212.  
  1213. - LINE FEEDS
  1214.  
  1215. Command:
  1216.  
  1217.  >lf [...]
  1218.  
  1219. ("line feeds"; the command must be given in its abbreviated 
  1220. form only)
  1221.  
  1222. Action:
  1223.  
  1224. Changes the way Flash handles the ends of text lines that are 
  1225. received or transmitted in text transfers. With line feeds on, 
  1226. every <return> is converted to a <return>/line-feed combination.
  1227. With line feeds off, nothing is converted. Set this to match
  1228. what the other system expects.
  1229.  
  1230. Parameters:
  1231.  
  1232.  on
  1233.  
  1234.  of (off)
  1235.  
  1236. / (a toggle between "on" and "off")
  1237.  
  1238. $X (any variable containing "on," "of" or "/")
  1239.  
  1240.  
  1241. Examples:
  1242.  
  1243.  >lf on|
  1244.  
  1245.  >lf /|
  1246.  
  1247.  >lf $X|
  1248.  
  1249.  
  1250.  
  1251.  
  1252. - MODEM CONNECT MESSAGE
  1253.  
  1254. Command:
  1255.  
  1256.  >mc [...]
  1257.  
  1258. ("modem connect"; the command must be given in its abbreviated 
  1259. form only)
  1260.     
  1261. Action:
  1262.  
  1263. Tells Flash what your modem will echo back to Flash, in 
  1264. English, when another modem answers a call that your modem 
  1265. makes.
  1266.  
  1267. Parameters:
  1268.  
  1269.  CONNECT
  1270.  
  1271.  $X (any variable containing the desired modem-connect text)
  1272.  
  1273.  
  1274. Examples:
  1275.  
  1276.  >mc "CONNECT"|
  1277.  
  1278.  >mc $X|
  1279.  
  1280.  
  1281.  
  1282.  
  1283. - MODEM FAIL MESSAGES
  1284.  
  1285. Command:
  1286.  
  1287.  >mf [... optional]
  1288.  
  1289. ("modem fail"; the command must be given in its abbreviated 
  1290. form only)
  1291.  
  1292. Action:
  1293.  
  1294. Tells Flash which of the predetermined "modem fail" messages 
  1295. listed in the dial directory will echo back to Flash if a dial
  1296. command is not successful. If you do not have any "modem fail"
  1297. messages listed in the dial directory, use the "text" parameter
  1298. or the variable instead. (Or edit your dial directory properly.)
  1299.  
  1300. Parameters:
  1301.     
  1302. [none] (if no parameter is given, Flash uses the default 
  1303. parameter, which is #1)
  1304.  
  1305.  1 (message #1 in the dial directory)
  1306.  
  1307.  2 (message #2 in the dial directory)
  1308.  
  1309.  3 (message #3 in the dial directory)
  1310.  
  1311.  4 (message #4 in the dial directory)
  1312.  
  1313.  "text" (any message, such as "BUSY")
  1314.  
  1315.  $X (any variable containing a modem-fail message)
  1316.  
  1317. Examples:
  1318.  
  1319.  >mf|
  1320.  
  1321.  >mf 2|
  1322.  
  1323.  >mf $X|
  1324.  
  1325.  
  1326.  
  1327.  
  1328. - EMULATION MODES
  1329.  
  1330. Command:
  1331.  
  1332.  >mo [...]
  1333.  
  1334. (mode)
  1335.  
  1336. Action:
  1337.  
  1338. Chooses the terminal emulation mode. The standard mode for STs 
  1339. is "at" (Atari). You must match the other computer's mode.
  1340.  
  1341. Parameters:
  1342.  
  1343.  an (ansi; this lets Flash show some of the text attributes of 
  1344. the ANSI standard, used by many PCs)
  1345.  
  1346.  at (atari; this is also called "VT52" and is a standard PC 
  1347.  setting)
  1348.  
  1349.  vi (vidtex; a once-popular display mode that can display 
  1350. graphics along with text)
  1351.  
  1352.  $X (any variable containing "an," "at" or "vi")
  1353.  
  1354. Examples:
  1355.  
  1356.  >mo at|
  1357.  
  1358.  >mo $X|
  1359.  
  1360.  
  1361.  
  1362.  
  1363. - DIALING PREFIX
  1364.  
  1365. Command:
  1366.  
  1367.  >mp [...]
  1368.  
  1369. ("modem prefix"; the command must be given in its abbreviated 
  1370. form only)
  1371.  
  1372. Action:
  1373.  
  1374. Tells Flash what text to place in front of the modem dialing 
  1375. command. This is usually "ATDP" for pulse-tone (rotary dial)
  1376. lines and "ATDT" for touch-tone lines.
  1377.  
  1378. Parameters:
  1379.  
  1380.  "ATDP"
  1381.  
  1382.  "ATDT"
  1383.  
  1384.  "TEXT" (any modem dialing string prefix; capital letters are 
  1385. safest)
  1386.  
  1387.  $X (any variable containing a dialing string prefix; capital
  1388. letters may be necessary)
  1389.  
  1390. Examples:
  1391.  
  1392.  >mp "ATDT"|
  1393.  
  1394.  >mp $X|
  1395.  
  1396.  
  1397.  
  1398.  
  1399. - DIALING SUFFIX
  1400.  
  1401. Command:
  1402.  
  1403.  >ms [...]
  1404.  
  1405. ("modem suffix"; the command must be given in its abbreviated 
  1406. form only)
  1407.  
  1408. Action:
  1409.  
  1410. Tells Flash what text to place after the modem dialing command. 
  1411. Generally not needed.
  1412.  
  1413. Parameters:
  1414.  
  1415. "TEXT" (sometimes can be lower case)
  1416.  
  1417. $X (any variable containing a modem suffix; capital letters may 
  1418. be necessary)
  1419.  
  1420. Examples:
  1421.  
  1422. >ms $X|
  1423.  
  1424.  
  1425.  
  1426.  
  1427. - PARITY
  1428.  
  1429. Command:
  1430.  
  1431. >py [...]
  1432.  
  1433. ("parity"; the command must be given in its abbreviated form 
  1434. only)
  1435.  
  1436. Action:
  1437.  
  1438. Sets the parity of bytes that are sent and received. By itself, 
  1439. parity means little, but you should match Flash's parity with 
  1440. the setting used by the other computer.
  1441.  
  1442. Parameters:
  1443.  
  1444. no (none)
  1445.  
  1446. od (odd)
  1447.  
  1448. ev (even)
  1449.  
  1450. $X (any variable containing "no," "od" or "ev")
  1451.  
  1452. Examples"
  1453.  
  1454.  >py no|
  1455.  
  1456.  >py $X|
  1457.  
  1458.  
  1459.  
  1460.  
  1461. - NUMBER OF REDIALS
  1462.  
  1463. Command:
  1464.  
  1465.  >re [...]
  1466.  
  1467. (redial)
  1468.  
  1469. Action:
  1470.  
  1471. Tells Flash how many times to redial a number if it receives a 
  1472. "modem fail" message (if the number is busy or if for some
  1473. reason the modem can't get through). Note that a redial setting
  1474. of 1 means Flash will dial twice if necessary.
  1475.  
  1476. Parameters:
  1477.  
  1478. 0-99 (any number from 0 to 99)
  1479.  
  1480. Example:
  1481.  
  1482.  >re 5|
  1483.  
  1484.  
  1485.  
  1486.  
  1487. - BACKSPACE BEHAVIOR
  1488.  
  1489. Command:
  1490.  
  1491.  >ru [...]
  1492.  
  1493. (rubout)
  1494.  
  1495. Action:
  1496.  
  1497. Changes the way the <backspace> key behaves during on-line 
  1498. communication. With "ru" on, <backspace> deletes characters on 
  1499. both screens. With "ru" off, <backspace> merely backs up the
  1500. cursor.
  1501.  
  1502. Parameters:
  1503.  
  1504.  on
  1505.  
  1506.  of (off)
  1507.  
  1508.  / (a toggle between "on" and "off")
  1509.  
  1510.  
  1511. Examples:
  1512.  
  1513.  >ru on|
  1514.  
  1515.  >ru /|
  1516.  
  1517.  
  1518.  
  1519.  
  1520. - STOP BITS
  1521.  
  1522. Command:
  1523.  
  1524. >sb [...]
  1525.  
  1526. ("stop bits"; the command must be given in its abbreviated form 
  1527. only)
  1528.  
  1529. Action:
  1530.  
  1531. Sets the number of stop bits in bytes that are sent and 
  1532. received. By itself, this setting means very little, but you
  1533. should match Flash's setting with whatever the other system is
  1534. using.
  1535.  
  1536. Parameters:
  1537.  
  1538.  1
  1539.  
  1540.  2
  1541.  
  1542.  $X (any variable that contains "1" or "2")
  1543.  
  1544. Examples:
  1545.  
  1546.  >sb 1|
  1547.  
  1548.  >sb $X|
  1549.  
  1550.  
  1551.  
  1552.  
  1553. - STRIP BIT
  1554.  
  1555. Command:
  1556.  
  1557.  >st [...]
  1558.  
  1559. (strip)
  1560.  
  1561. Action:
  1562.  
  1563. Sets the "strip-bit" toggle on or off. The bit that is stripped 
  1564. is the "high bit," which determines whether a character is "high
  1565. ASCII" or not. This functions only in text capture and text 
  1566. send.
  1567.  
  1568. Parameters:
  1569.  
  1570.  on
  1571.  
  1572.  of (off)
  1573.  
  1574.  / (a toggle between "on" and "off")
  1575.  
  1576. Examples:
  1577.  
  1578.  >st on|
  1579.  
  1580.  >st /|
  1581.  
  1582.  
  1583.  
  1584.  
  1585. - BYTE LENGTH
  1586.  
  1587. Command:
  1588.  
  1589.  >wl [...]
  1590.  
  1591. ("word length"; the command must be given in its abbreviated 
  1592. form only)
  1593.  
  1594. Action:
  1595.  
  1596. Sets Flash's byte length to 7 bits or 8 bits. This is called 
  1597. the word length, although it has nothing to do with English
  1598. words. Nearly all PC communication uses 8-bit byte (word)
  1599. lengths these days.
  1600.  
  1601. Parameters:
  1602.  
  1603.  7
  1604.  
  1605.  8
  1606.  
  1607.  $X (any variable containing "7" or "8")
  1608.  
  1609. Examples:
  1610.  
  1611.  >wl 8|
  1612.  
  1613.  >wl $X|
  1614.  
  1615.  
  1616.  
  1617.  
  1618. - Xmodem TYPE
  1619.  
  1620. Command:
  1621.  
  1622.  >xm
  1623.  
  1624. (Xmodem)
  1625.  
  1626. Action:
  1627.  
  1628. Determines the type of Xmodem that Flash will use, and a few 
  1629. other aspects of file transfers.
  1630.  
  1631. Parameters:
  1632.  
  1633.  7 (7-bit Xmodem; rarely used any more)
  1634.  
  1635.  8 (8-bit Xmodem; the standard bit setting)
  1636.  
  1637.  C (CRC Xmodem, the preferred error-checking setting; absence 
  1638. of the "C" parameter will force Flash to choose an older, less
  1639. satisfactory setting, usually called checksum Xmodem)
  1640.  
  1641. R ("regular" block lengths of 128 bytes K (1-kilobyte block
  1642. lengths)
  1643.  
  1644.  T ("Tight" timing of Xmodem block transfers, for good phone 
  1645. connections)
  1646.  
  1647.  L ("Loose" timing of Xmodem block transfers, for poor phone 
  1648. connections)
  1649.  
  1650.  S ("Size-byte" padding of the last block in the transmitted 
  1651. file, used by Atari 8-bit systems)
  1652.  
  1653.  Z (Control-Z padding of the last block in the transmitted 
  1654. file, the standard PC and ST method)
  1655.  
  1656. $X (any variable containing parameters as listed above)
  1657.  
  1658. Examples:
  1659.  
  1660.  >xm 8CKZ|
  1661.  
  1662.  >xm $X|
  1663.  
  1664.  
  1665.  
  1666.  
  1667. Sending and receiving files
  1668. ---------------------------
  1669.  
  1670.  
  1671. Flash's primary function as a telecomm program is to send and 
  1672. receive data in the form of files. Scripts make this easy.
  1673.  
  1674.  
  1675. - UPLOADING
  1676.  
  1677. Command:
  1678.  
  1679.  >ul [...] [...] [...]
  1680.  
  1681. (upload)
  1682.  
  1683. Action:
  1684.  
  1685. Sends a file to another computer, either from a disk or from 
  1686. Flash's buffer. The upload command has either two or three 
  1687. parameters -- two if you are uploading from a disk file, and 
  1688. three if you are uploading from the buffer.
  1689.  
  1690. Parameters:
  1691.  
  1692. The upload command works this way if you are sending from a disk 
  1693. file:
  1694.  
  1695.  >ul as filename.ext (for an ASCII text upload)
  1696.  
  1697.  >ul xm filename.ext (for an Xmodem data or text upload)
  1698.  
  1699.  >ul yb *.* (for a Ymodem batch upload; wildcards are needed)
  1700.  
  1701. The "filename" parameter can be in the form of 
  1702. "filepath\filename.ext" and it can be a variable, such as "$X," 
  1703. or a string of variables, if they are used for the path and 
  1704. filename.
  1705.  
  1706.  
  1707. The upload command works this way if you are sending from the 
  1708. Flash capture buffer:
  1709.  
  1710.  >ul ca as filename.ext (for an ASCII upload of the entire 
  1711.  buffer)
  1712.  
  1713.  >ul ca xm filename.ext (for an Xmodem upload of the entire 
  1714.  buffer)
  1715.  
  1716.  
  1717. It works this way if you are sending the part of the buffer that 
  1718. you have blocked off:
  1719.  
  1720.  >ul bl as (etc.)
  1721.  
  1722.  >ul bl xm (etc.)
  1723.  
  1724.  
  1725.  
  1726. - DOWNLOADING
  1727.  
  1728. Command:
  1729.  
  1730.  >dl
  1731.  
  1732. (download)
  1733.  
  1734. Action:
  1735.  
  1736. In every respect but one, the download command works the same 
  1737. way as the upload command. The exception is the lack of any way 
  1738. to download, using the "dl" command,to the capture buffer. (You 
  1739. can, however, merely turn the capture buffer on and save all the
  1740. text that is coming across from the other computer. This is, in
  1741. effect, the same as an ASCII download.)
  1742.  
  1743. Here are two sample command lines:
  1744.  
  1745.  >dl xm filepath\filename
  1746.  
  1747.  >dl as $X\$Y (the variables represent the filepath and filename)
  1748.  
  1749.  
  1750.  
  1751.  
  1752. Creating and using blocks from a script
  1753. ---------------------------------------
  1754.  
  1755.  
  1756. If you have used Flash's built-in text editor for more than just 
  1757. reading texts, you may be familiar with its block functions. 
  1758. They are readily accessed from the first four function keys 
  1759. while you are using the editor (in the GEM screen). You can 
  1760. easily tell when you have blocked off text in the editing 
  1761. buffer, since it turns gray.
  1762.  
  1763. Function key 1 marks the top of a block; 2 marks the bottom; 3 
  1764. clears the marks, and 4 deletes the marked block. A GEM menu bar 
  1765. submenu allows you to save the marked block, and you can also 
  1766. append the block to a file and upload the block.
  1767.  
  1768. All but one of these functions can be accessed from a DO script. 
  1769. The one that does not work directly in a script is the 
  1770. delete-block function. All the others can be done under control 
  1771. of the script.
  1772.  
  1773. The typical way of manipulating text in the buffer is by turning 
  1774. the capture buffer on (with the "ca on" command string), saving
  1775. the text that is entered, then clearing the capture buffer so 
  1776. that you can start the process over. (This technique is used in 
  1777. many of the DO file examples here.)
  1778.  
  1779. But there may be times when you do not want to disturb the text 
  1780. in the buffer -- when you are saving all messages that come in 
  1781. from a BBS, for example. Yet you may also want to save parts of 
  1782. the buffer at the same time. That's where the block features 
  1783. come in handy.
  1784.  
  1785.  
  1786. Here are the five block commands:
  1787.  
  1788.  >mk top
  1789.  
  1790. (mark the top of a block)
  1791.  
  1792.  >mk bot
  1793.  
  1794. (nark the bottom of a block)
  1795.  
  1796.  >mk cl
  1797.  
  1798. (clear the block
  1799.  
  1800.  >ap bl filename.ext
  1801.  
  1802. (append the block to a file)
  1803.  
  1804.  >sa bl filename.ext
  1805.  
  1806. (save the block to a file)
  1807.  
  1808.  
  1809. Here is a routine that uses block commands in a script:
  1810.  
  1811. >do callbbs.do|
  1812. >do sendmsgs.do|
  1813. >se "Read|"|
  1814. >ca on|
  1815. >** buffer is now saving everything|
  1816. >wa "Atari"|
  1817. >mk top|
  1818. >wa "no more messages"|
  1819. >mk bot|
  1820. >ap bl atarimsg.txt|
  1821. >mk cl|
  1822. >** saves Atari-related messages to a separate file.|
  1823. >do sendmail.do|
  1824. >do logoff.do|
  1825. >sa ca bbslog.txt|
  1826. >** saves entire capture buffer to log file.|
  1827.  
  1828.  
  1829.  
  1830.  
  1831. Setting Flash's display and sound options
  1832. -----------------------------------------
  1833.  
  1834.  
  1835. These commands control what Flash shows on the screen and what 
  1836. sounds Flash makes.
  1837.  
  1838.  
  1839.  
  1840. - TIME SET
  1841.  
  1842. Command:
  1843.  
  1844.  >sc [...]
  1845.  
  1846. ("set clock"; the command must be given in its abbreviated form 
  1847. only)
  1848.  
  1849. Action:
  1850.  
  1851. Sets the system clock, using the 24-hour time given in the parameter.
  1852.  
  1853. Parameters:
  1854.  
  1855.  "time" (in 00:00:00 form)
  1856.  
  1857. Example:
  1858.  
  1859.  >sc 16:23:00|
  1860.  
  1861.  
  1862.  
  1863.  
  1864. - CLOCK DISPLAY
  1865.  
  1866. Command:
  1867.  
  1868.  >cl
  1869.  
  1870. (clock)
  1871.  
  1872. Action:
  1873.  
  1874. Displays the time in the upper right corner of the screen. The 
  1875. time display is normally on unless Flash receives a "ti" (timer)
  1876. command or an "rt" (reset timer) command. In these cases, "cl"
  1877. redisplays the time.
  1878.  
  1879. Parameters:
  1880.  
  1881.  none
  1882.  
  1883. Example:
  1884.  
  1885.  >cl|
  1886.  
  1887.  
  1888.  
  1889.  
  1890. - TIMER DISPLAY
  1891.  
  1892. Command:
  1893.  
  1894.  >ti
  1895.  
  1896. (timer)
  1897.  
  1898. Action:
  1899.  
  1900. Changes the clock display, at the upper right corner of the 
  1901. screen, to a timer. The timer is automatically set to zero every
  1902. time a connection is made, or it can be reset to zero by the
  1903. "rt" (reset timer) command.
  1904.  
  1905. Parameters:
  1906.  
  1907.  none
  1908.  
  1909. Example:
  1910.  
  1911.  >ti|
  1912.  
  1913.  
  1914.  
  1915.  
  1916. - RESETTING TIMER
  1917.  
  1918. Command:
  1919.  
  1920.  >rt 
  1921.  
  1922. ("reset timer"; the command must be given in its abbreviated 
  1923. form only)
  1924.  
  1925. Action:
  1926.  
  1927. Resets the timer within Flash to zero. The timer will not be 
  1928. shown on the screen unless the "ti" command is given.
  1929.  
  1930. Parameters:
  1931.  
  1932.  none
  1933.  
  1934. Example:
  1935.  
  1936. >ti|
  1937.  
  1938.  
  1939.  
  1940.  
  1941. - HIGH RESOLUTION
  1942.  
  1943. Command:
  1944.  
  1945.  >hi
  1946.  
  1947. (high)
  1948.  
  1949. Action:
  1950.  
  1951. Changes the monochrome-monitor to 48-line display mode. Does 
  1952. nothing if a color monitor is being used.
  1953.  
  1954. Parameters:
  1955.  
  1956.  none
  1957.  
  1958. Example:
  1959.  
  1960.  >hi|
  1961.  
  1962.  
  1963.  
  1964.  
  1965. - VIEWING TEXTS OR VIDTEX GRAPHICS
  1966.  
  1967.  
  1968.  >vi [...]
  1969.  
  1970. (view)
  1971.  
  1972. Action:
  1973.  
  1974. Display a text file on the screen, with screen-by-screen paging 
  1975. controlled by the <spacebar>. If the mode is set to "vi" 
  1976. (Vidtex), this command will display a Vidtex graphic as well.
  1977. (Note that the command "vi" and the parameter "vi" are
  1978. identically spelled but have different meanings.)
  1979.  
  1980. Parameters:
  1981.  
  1982.  "filepath\filename.ext" (the optional path and optional full 
  1983. filename of the text to be shown; if a wildcard is used, Flash
  1984. will display the first file it finds that matches the wildcard
  1985. specification)
  1986.  
  1987.  $X (any variable containing the filespec as explained above)
  1988.  
  1989. Examples:
  1990.  
  1991.  >vi c:\flash\flashdo.txt|
  1992.  
  1993.  >vi $X|
  1994.  
  1995.  
  1996.  
  1997.  
  1998. - BELL SOUNDS
  1999.  
  2000. Command:
  2001.  
  2002.  >b1
  2003.  
  2004. (single bell)
  2005.  
  2006. Action:
  2007.  
  2008. Sends a single bell sound to the monitor's speaker. It can be 
  2009. repeated as often as you want, by looping the command or by 
  2010. placing it many times in the script.
  2011.  
  2012. Parameters:
  2013.  
  2014.  none
  2015.  
  2016. Example:
  2017.  
  2018.  >b1|
  2019.  
  2020.  
  2021.  
  2022.  
  2023. Command:
  2024.  
  2025.  >b2
  2026.  
  2027. (repeating bell)
  2028.  
  2029. Action:
  2030.  
  2031. Sends a repeating bell sound to the speaker for about 25 
  2032. seconds. If you press any key during this time, Flash stops the 
  2033. bell sound and the script resumes. Otherwise, the script 
  2034. resumes when the tolling stops.
  2035.  
  2036. Parameters:
  2037.  
  2038.  none
  2039.  
  2040. Example:
  2041.  
  2042.  >b2|
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048. Setting and using directory paths and files
  2049. -------------------------------------------
  2050.  
  2051.  
  2052. These are the commands Flash uses to operate on files.
  2053.  
  2054.  
  2055. - LOADING A FILE
  2056.  
  2057. Command:
  2058.  
  2059.  >lo [...] [... optional path, mandatory filename or wildcard]
  2060.  
  2061. (load)
  2062.  
  2063. Action:
  2064.  
  2065. Load a file into Flash. The parameter is in two parts: The type 
  2066. of file to be loaded, and the path and name of the file. The
  2067. file can be a text file loaded into Flash's text buffer using
  2068. the "ca" parameter, a configuration file loaded with the "co"
  2069. parameter, a dialing directory loaded through the "di"
  2070. parameter, a set of function-key "bindings" (key presses assigned
  2071. to function keys) loaded via the "fk" parameter, or translation
  2072. tables to change incoming and outgoing characters loaded by way
  2073. of the "tr" parameter. If you use a wildcard instead of a full
  2074. filename, Flash will load the first file that matches the
  2075. wildcard. CHECK THIS.
  2076.  
  2077. Parameters:
  2078.  
  2079. (Note: If you do not specify the location of the file to be 
  2080. loaded, Flash looks for it in the default folder, the one Flash 
  2081. was executed from.)
  2082.  
  2083.  ca d:\filepath\filename.ext (any drive and folder path)
  2084.  
  2085. (capture buffer)
  2086.  
  2087.  co d:\filepath\filename.ext
  2088.  
  2089. (configuration file; the default is FLASH.CNF, but you can name
  2090. other configuration files any name you choose)
  2091.  
  2092.  di d:\filepath\filename.ext
  2093.  
  2094. (dialing directory; the default is FLASH.DIR, but you can name
  2095. other dialing directories anything you wish)
  2096.  
  2097.  fk d:\filepath\filename.ext
  2098.  
  2099. (function-key assignments; the default is the wonderfully named
  2100. FUNCKEY.DEF, but you can use any other name for optional
  2101. function-key loaders)
  2102.  
  2103.  tr d:\filepath\filename.ext
  2104.  
  2105. (translation tables; FLASH.TRN is the default, but any name is
  2106. OK for optional tables)
  2107.  
  2108.  [...] $X
  2109.  
  2110. (any variable containing d:\filepath\filename.ext)
  2111.  
  2112. Examples:
  2113.  
  2114.  >lo ca c:\flash\messages.txt|
  2115.  
  2116.  >lo ca $X|
  2117.  
  2118.  >lo di c:\flash\localbbs.dir|
  2119.  
  2120.  
  2121.  
  2122.  
  2123. - SAVING A FILE
  2124.  
  2125. Command:
  2126.  
  2127.  >sa [...] [... optional path, mandatory filename]
  2128.  
  2129. (save)
  2130.  
  2131. Action:
  2132.  
  2133. Save a file into Flash. The parameter is in two parts: The type 
  2134. of file to be loaded, and the path and name of the file. The
  2135. file can be a text file saved from Flash's text buffer using the
  2136. "ca" parameter, a configuration file saved with the "co"
  2137. parameter, a dialing directory saved through the "di" parameter,
  2138. a set of function-key "bindings" (key presses assigned to
  2139. function keys) saved via the "fk" parameter, or translation
  2140. tables to change incoming and outgoing characters saved using
  2141. the "tr" parameter.
  2142.  
  2143. Parameters:
  2144.  
  2145. (Note: If you do not specify the location of the file to be 
  2146. saved, Flash saves it in the default folder, the one Flash was
  2147. executed from.)
  2148.  
  2149.  ca d:\filepath\filename.ext (any drive and folder path)
  2150.  
  2151. (capture buffer)
  2152.  
  2153.  co d:\filepath\filename.ext
  2154.  
  2155. (configuration file; the default is FLASH.CNF, but you can name
  2156. other configuration files any name you choose)
  2157.  
  2158.  di d:\filepath\filename.ext
  2159.  
  2160. (dialing directory; the default is FLASH.DIR, but you can name
  2161. other dialing directories anything you wish)
  2162.  
  2163.  fk d:\filepath\filename.ext
  2164.  
  2165. (function-key assignments; the default is FUNCKEY.DEF, but you
  2166. can use any other name for optional function-key loaders)
  2167.  
  2168.  tr d:\filepath\filename.ext
  2169.  
  2170. (translation tables; FLASH.TRN is the default, but any name is
  2171. OK for optional tables)
  2172.  
  2173.  [ ] $X (any variable containing d:\filepath\filename.ext)
  2174.  
  2175. Examples:
  2176.  
  2177.  >sa ca a:\messages.txt|
  2178.  
  2179.  >sa ca $X|
  2180.  
  2181.  >sa fk c:\flash\fkey\funckey2.def|
  2182.  
  2183.  
  2184.  
  2185.  
  2186. - CHANGING A DIRECTORY PATH
  2187.  
  2188. Command:
  2189.  
  2190. >cd [...]
  2191.  
  2192. (change directory; the command must be given in its abbreviated 
  2193. form only)
  2194.  
  2195. Action:
  2196.  
  2197. Tells Flash to look in the specified path for all files and to 
  2198. use that path when saving files unless another path is specified
  2199. in individual commands. Note: This command is identical to "dp".
  2200.  
  2201. Parameters:
  2202.  
  2203.  d:\filepath\filename.ext
  2204.  
  2205.  $X (any variable containing a path and filename)
  2206.  
  2207. Examples:
  2208.  
  2209. (Note that the trailing slash is necessary.)
  2210.  
  2211.  >cd c:\flash\|
  2212.  
  2213.  >cd $X|
  2214.  
  2215.  
  2216.  
  2217.  
  2218. - SETTING A DEFAULT DIRECTORY
  2219.  
  2220. Command:
  2221.  
  2222. >dp [...]
  2223.  
  2224. (default path; the command must be given in its abbreviated 
  2225. form only)
  2226.  
  2227. Action:
  2228.  
  2229. Tells Flash to look in the specified path for all files and to 
  2230. use that path when saving files unless another path is specified
  2231. in individual commands. Note: This command is identical to "cd."
  2232.  
  2233. Parameters:
  2234.  
  2235.  d:\filepath\filename.ext
  2236.  
  2237.  $X (any variable containing a path and filename)
  2238.  
  2239. Examples:
  2240.  
  2241. (Note that the trailing slash is necessary.)
  2242.  
  2243.  >dp c:\flash\|
  2244.  
  2245.  >dp $X|
  2246.  
  2247.  
  2248.  
  2249.  
  2250. - CHECKING DISK SPACE
  2251.  
  2252. Command:
  2253.  
  2254.  >df [... optional]
  2255.  
  2256. (disk free)
  2257.  
  2258. Action:
  2259.  
  2260. Displays the amount of free space on the default drive, or, if 
  2261. a filepath is given, on that drive. Note that the first two
  2262. parameter examples listed below accomplish the same thing.  
  2263. Flash will not show the free space in a folder per se, since
  2264. folders can hold as much as the entire drive they are on, minus
  2265. a little overhead.
  2266.  
  2267. Parameters:
  2268.  
  2269.  d:
  2270.  
  2271.  d:\filepath\
  2272.  
  2273.  $X (any variable containing a drive specifier)
  2274.  
  2275. Examples:
  2276.  
  2277.  >df c:|
  2278.  
  2279.  >df $X|
  2280.  
  2281.  
  2282.  
  2283.  
  2284. - LISTING FILES IN DIRECTORY
  2285.  
  2286. Command:
  2287.  
  2288.  >dd [... optional] [... optional]
  2289.  
  2290. (disk directory)
  2291.  
  2292. Action:
  2293.  
  2294. Lists the folders and files in the filepath specified as the 
  2295. first parameter, or in the default path if no specification is
  2296. given. The list is written to the screen as the default, but it 
  2297. can also be written to a disk file or sent out the modem port.
  2298.  
  2299. Parameters:
  2300.  
  2301. Note: The trailing slash is required.
  2302.  
  2303.  d:\filepath\filename.ext (any filepath; wildcards are allowed 
  2304. for the filename)
  2305.  
  2306.  d:\filepath\*.* AUX: (sends the list to the modem, the "AUX:" 
  2307. device on the ST; a space is needed in front of "AUX:")
  2308.  
  2309.  d:\filepath\*.* filename.ext (writes the list to a disk file)
  2310.  
  2311. Examples:
  2312.  
  2313.  >dd|
  2314.  
  2315.  >dd AUX:|
  2316.  
  2317.  >dd c:\flash\*.txt|
  2318.  
  2319.  >dd a:\dofiles\*.*
  2320.  
  2321.  >dd c:\bbstexts\local\numbers.* AUX:|
  2322.  
  2323.  >dd c:\flash\do\*.do dolist.txt|
  2324.  
  2325.  
  2326. - OPENING A FILE
  2327.  
  2328. Command:
  2329.  
  2330.  op [...]
  2331.  
  2332. (open)
  2333.  
  2334. Action:
  2335.  
  2336. Opens a disk file, using a standard filespec, or the Flash 
  2337. capture buffer, using "BUF:", to check or read the  data, or
  2338. opens the modem port, using "AUX:". Flash can be instructed to
  2339. report on whether the operation was successful. In other words,
  2340. Flash can test to see if a particular file exists -- or even any
  2341. file at all exists, with wildcards -- using the "op" command.
  2342. The "op" command is tested by issuing an "if" command followed
  2343. by a tilde (the "~" character) in front of "op". See the context
  2344. examples below for the use of "op" with files. The function of
  2345. "op" with "BUF:" and "AUX:" is covered in "Making better use of
  2346. the capture buffer" below.
  2347.  
  2348. Parameters:
  2349.  
  2350.  d:\filepath\filename
  2351.  
  2352.  d:\filepath\*.*
  2353.  
  2354.  BUF:
  2355.  
  2356.  AUX:
  2357.  
  2358.  $X (any variable containing a filespec, "BUF:" or "AUX:")
  2359.  
  2360. Examples:
  2361.  
  2362.  >op c:\wordproc\feblettr.txt|
  2363.  
  2364.  >op a:\dofiles\*.do|
  2365.  
  2366.  >op BLK:|
  2367.  
  2368.  >op BUF:|
  2369.  
  2370.  >op $X|
  2371.  
  2372.  
  2373. Context examples:
  2374.  
  2375.  
  2376. >op c:\flash\messages\bbsdaily.txt|
  2377. >if ~op sa ca c:\flash\messages\daily.txt|
  2378. >**
  2379.  
  2380. Checks to see if the daily message file exists.  If it does not 
  2381. exist, Flash saves the contents of the capture buffer to a new 
  2382. file of that name.
  2383.  
  2384. |
  2385.  
  2386.  
  2387. >op a:\errorlog.txt|
  2388. >if ~op jmp noerrors|
  2389. >vi a:\errorlog.txt|
  2390. >L: noerrors|
  2391. >**
  2392.  
  2393. Checks for the presence of an error log and displays it on the
  2394. screen if found.
  2395.  
  2396. |
  2397.  
  2398.  
  2399.  
  2400.  
  2401. - KILLING A FILE
  2402.  
  2403. Command:
  2404.  
  2405.  >ki [...]
  2406.  
  2407. (kill)
  2408.  
  2409. Action:
  2410.  
  2411. Kills (deletes) a file. The parameter can include a filepath as 
  2412. well as a filename, and can include wildcards. If wildcards are
  2413. used, Flash deletes the first file it finds that matches the
  2414. wildcard specification. Multiple deletions can be made by
  2415. issuing the "ki" command with a wildcard parameter, checking to
  2416. see if any files still exist in the path using the "op" command,
  2417. and looping back through those two commands until the "op"
  2418. command does not find a file. See the context example below.
  2419.  
  2420. Parameters:
  2421.  
  2422.  d:\filepath\filename.ext
  2423.  
  2424. (kills a single file in that folder)
  2425.  
  2426.  d:\filename
  2427.  
  2428. (kills a single file in the root directory of d:)
  2429.  
  2430.  d:filename
  2431.  
  2432. (kills a single file in the default directory; the "d:" can be
  2433. omitted)
  2434.  
  2435.  d:\filepath\*.txt
  2436.  
  2437. (kills the first file it finds in that directory having a ".txt"
  2438. extender)
  2439.  
  2440. $X (any variable containing a filespec)
  2441.  
  2442. Examples:
  2443.  
  2444.  >ki a:\oldmsg.txt|
  2445.  
  2446.  >ki c:\flash\*.bak|
  2447.  
  2448.  >ki $X|
  2449.  
  2450.  
  2451. Context examples:
  2452.  
  2453. ** Killing all files in a pathway using wildcards **
  2454.  
  2455. >L: filekiller|
  2456. >ki c:\flash\oldfiles\*.*|
  2457. >op c:\flash\oldfiles\*.*|
  2458. >if op jmp filekiller|
  2459. >**
  2460.  
  2461. If Flash cannot open any file matching the wildcard spec, the 
  2462. loop is broken. Otherwise, it continues to delete files.
  2463.  
  2464. |
  2465.  
  2466.  
  2467.     
  2468.  
  2469. ** Killing selected files using wildcards **
  2470.  
  2471. >L: filekiller|
  2472. >ki c:\flash\oldfiles\*.txt|
  2473. >op c:\flash\oldfiles\*.txt|
  2474. >if op jmp filekiller|
  2475. >**
  2476.  
  2477. If Flash cannot open any file matching the wildcard spec, the 
  2478. loop is broken. Otherwise, it continues to delete files.
  2479.  
  2480. |
  2481.  
  2482.  
  2483.  
  2484.  
  2485. Using the capture buffer from a DO script
  2486. -----------------------------------------
  2487.  
  2488.  
  2489. Flash's capture buffer is more than just a place to store text. 
  2490. It can be used to manipulate text, and it can even be used to
  2491. make copies of program files and data files, in addition to text
  2492. files.
  2493.  
  2494.  
  2495. - TURNING THE CAPTURE BUFFER ON AND OFF
  2496.  
  2497. Command:
  2498.  
  2499.  >ca [...]
  2500.  
  2501. (capture)
  2502.  
  2503. Action:
  2504.  
  2505. Turns the capture buffer on or off. Note: Turning the capture 
  2506. buffer off does not affect anything already in the buffer; it
  2507. merely shuts the buffer so that nothing is added.
  2508.  
  2509. Parameters:
  2510.  
  2511.  on
  2512.  
  2513.  of (off)
  2514.  
  2515. \ (a toggle between on and off; this is not a satisfactory way 
  2516. of handling the capture buffer in a script, since you may not be
  2517. able to control which setting is being switched)
  2518.     
  2519. Examples:
  2520.  
  2521.  >ca on|
  2522.  
  2523.  >ca of|
  2524.  
  2525.  >ca \|
  2526.  
  2527.  
  2528.  
  2529.  
  2530. - CLEARING THE BUFFER
  2531.  
  2532. Command:
  2533.  
  2534.  >cl
  2535.  
  2536. (clear)
  2537.  
  2538. Action:
  2539.  
  2540. Clears the capture buffer. Everything is removed, whether the 
  2541. buffer is on or off at the time.
  2542.  
  2543. Parameters:
  2544.  
  2545.  none
  2546.  
  2547. Example:
  2548.  
  2549.  >ca cl|
  2550.  
  2551.  
  2552.  
  2553.  
  2554. - LOADING THE BUFFER
  2555.  
  2556. Command:
  2557.  
  2558.  >lo ca [...]
  2559.  
  2560. (load capture)
  2561.  
  2562. Action:
  2563.  
  2564. Loads a file into the capture buffer from the filespec given as 
  2565. the parameter. This command is also listed above, under "lo".
  2566.  
  2567. Parameters:
  2568.  
  2569.  d:\filepath\filename.ext
  2570.  
  2571.  $X (any variable containing a filespec)
  2572.  
  2573. Examples:
  2574.  
  2575.  >lo ca a:\bixmsgs.txt|
  2576.  
  2577.  >lo ca $X|
  2578.  
  2579.  
  2580.  
  2581.  
  2582. - SAVING THE BUFFER
  2583.  
  2584. Command:
  2585.  
  2586.  >sa ca [...]
  2587.  
  2588. (save capture)
  2589.  
  2590. Action:
  2591.  
  2592. Saves a file from the text in the capture buffer to a disk file 
  2593. using the filespec given as the parameter. This command is also 
  2594. listed above, under "sa".
  2595.  
  2596. Parameters:
  2597.  
  2598.  d:\filepath\filename.ext
  2599.  
  2600.  $X (any variable containing a filespec)
  2601.  
  2602.  
  2603. Examples:
  2604.  
  2605.  >sa ca a:\bixmsgs.txt|
  2606.  
  2607.  >sa ca $X|
  2608.  
  2609.  
  2610.  
  2611.  
  2612. - MARKING A BLOCK WITHIN THE BUFFER
  2613.  
  2614. Command:
  2615.  
  2616.  >mk [...]
  2617.  
  2618. (mark)
  2619.  
  2620. Action:
  2621.  
  2622. The "mk" command is awkwardly specified. Depending on the 
  2623. parameter chosen, it marks the top or the bottom of a block in
  2624. the capture buffer or clears the mark(s). The block can then be
  2625. saved or placed at the end of (appended to) a disk file.
  2626.  
  2627. Parameters:
  2628.  
  2629.  top (the beginning of a block of text)
  2630.  
  2631.  bot (the end of a block of text)
  2632.  
  2633.  cl (clear any marks)
  2634.  
  2635.  
  2636. Examples:
  2637.  
  2638.  >mk top|
  2639.  
  2640.  >mk bot|
  2641.  
  2642.  >mk cl|
  2643.  
  2644.  
  2645.  
  2646.  
  2647. - APPENDING A MARKED BLOCK TO THE END OF A FILE
  2648.  
  2649. Command:
  2650.  
  2651.  >ap bl [...]
  2652.  
  2653. (append block)
  2654.  
  2655. Appends the marked block to a disk file (places it at the end 
  2656. of the file).
  2657.  
  2658. Parameters:
  2659.  
  2660.  d:\filepath\filename.ext
  2661.  
  2662.  $X (any variable containing a filespec)
  2663.  
  2664.  
  2665. Examples:
  2666.  
  2667.  >ap bl c:\flash\filelist.txt|
  2668.  
  2669.  >ap bl $X|
  2670.  
  2671.  
  2672.  
  2673.  
  2674. Executing programs within Flash
  2675. -------------------------------
  2676.  
  2677.  
  2678. Unlike no-frills telecommunications programs, Flash is able to 
  2679. run other programs within Flash. They can be GEM programs, which
  2680. use the mouse and have GEM menus, or they can be either of the
  2681. two types of TOS programs -- regular TOS ("The Operating
  2682. System") or TTP ("TOS - Takes Parameters").
  2683.  
  2684.  
  2685. - RUNNING A GEM PROGRAM
  2686.  
  2687. Command:
  2688.  
  2689.  >gem [...]
  2690.  
  2691. (run a GEM program)
  2692.  
  2693. Action:
  2694.  
  2695. Executes a GEM program. The new program takes over and Flash 
  2696. disappears. When the program ends, Flash reappears. You can 
  2697. safely run all types of GEM programs *except* other
  2698. telecommunications programs, since Flash still has control of
  2699. the modem port even when it is running another program.  
  2700. However, you can run programs that support telecomm functions,
  2701. such as an external Zmodem module.
  2702.  
  2703. If Flash's capture buffer was turned on when the GEM program is 
  2704. launched, you may find that Flash will still try to store 
  2705. incoming data from another computer while the GEM program is
  2706. running. However, this can lead to system crashes and other
  2707. unexpected behavior unless the GEM program was designed to allow
  2708. Flash to do this.
  2709.  
  2710. Parameters:
  2711.  
  2712.  d:\filepath\filename.ext
  2713.  
  2714.  $X (any variable containing a filespec)
  2715.  
  2716.  
  2717. Examples:
  2718.  
  2719.  >gem c:\bin\wordperf\wp.prg|
  2720.  
  2721.  >gem $X|
  2722.  
  2723.  
  2724.  
  2725. - RUNNING A TOS OR TTP PROGRAM
  2726.  
  2727. Command:
  2728.  
  2729.  >exec [...] [... optional]
  2730.  
  2731. (execute)
  2732.  
  2733. Action:
  2734.  
  2735. Executes a TOS or TTP program. The new program takes over and 
  2736. Flash disappears. When the program ends, Flash reappears. You
  2737. can safely run all types of TOS and TTP programs *except* other
  2738. telecommunications programs, since Flash still has control of 
  2739. the modem port even when it is running another program. However,
  2740. you can run programs that support telecomm functions, such as an
  2741. external Zmodem module.
  2742.  
  2743. If Flash's capture buffer was turned on when the TOS or TTP 
  2744. program is launched, you may find that Flash will still try to
  2745. store incoming data from another computer while the TOS or TTP
  2746. program is running. However, this can lead to system crashes and
  2747. other unexpected behavior unless the TOS or TTP program was
  2748. designed to allow Flash to do this.
  2749.  
  2750. Parameters:
  2751.  
  2752. In addition to the usual filespec parameter, TOS programs can 
  2753. also accept command-line switches; TTP programs *must* have
  2754. command-line parameters and switches. (Their name, "TOS - Takes
  2755. Parameters," indicates the need for such command-line
  2756. parameters.) The most common parameters and switches may be
  2757. found in archivers such as ARC.TTP and LHARC.TTP, which need to
  2758. have the name of the file to be archived or extracted, along
  2759. with any other instructions. Usually, the only valid 
  2760. command-line parameter for TOS programs is a filename.
  2761.  
  2762.  d:\filepath\filename.ext [command-line parameters and switches]
  2763.  
  2764.  $X (any variable containing a filespec and optional switches)
  2765.  
  2766. Examples:
  2767.  
  2768.  >exec c:\STWriter\STWriter.tos mytext.stw|
  2769.  
  2770.  >exec c:\archives\lharc.ttp -x thisfile.lzh|
  2771.  
  2772.  >exec $X|
  2773.  
  2774.  
  2775.  
  2776. - A SPECIAL CASE: THE ARC COMMAND
  2777.  
  2778. Flash has an "exec" command that operates only on a file named 
  2779. ARC.TTP. It's the "arc" command. It is an alias for the "exec 
  2780. arc" command string. Although the official Flash documentation
  2781. makes no reference to this, you could name *any* .TTP program
  2782. "ARC" and run it this way (although why you would want to would
  2783. not be obvious).
  2784.  
  2785.  
  2786.  
  2787. Other commands
  2788. --------------
  2789.  
  2790.  
  2791. - PUTTING FLASH ON HOLD
  2792.  
  2793. Command:
  2794.  
  2795.  >pa [...]
  2796.  
  2797. (pause)
  2798.  
  2799. Action:
  2800.  
  2801. Halts all activity for the number of seconds specified in the 
  2802. parameter.
  2803.  
  2804. Parameter:
  2805.  
  2806.  # (number of seconds)
  2807.  
  2808. Examples:
  2809.  
  2810. >pa 3600|
  2811.  
  2812. >pa 1|
  2813.  
  2814.  
  2815.  
  2816. - SENDING A FORM FEED TO THE PRINTER
  2817.  
  2818. Command:
  2819.  
  2820.  >ff
  2821.  
  2822. (form feed)
  2823.  
  2824.  
  2825. Action:
  2826.  
  2827. Sends the printer a form feed (ejects or rolls up the current 
  2828. page). If the printer is not turned on, Flash will wait and 
  2829. then continue the script execution.
  2830.  
  2831. Parameters:
  2832.  
  2833.  none
  2834.  
  2835. Example:
  2836.  
  2837.  >ff|
  2838.  
  2839.  
  2840.  
  2841. - ENDING A ROUTINE OR THE ENTIRE SCRIPT
  2842.  
  2843. Command:
  2844.  
  2845.  
  2846.  >end
  2847.  
  2848. (end the script)
  2849.  
  2850. Action:
  2851.  
  2852. Stops the DO script. If the script was run from another script, 
  2853. Flash returns to the calling script at the next command in that 
  2854. script. You may have more than one "end" command in a script if 
  2855. you are using subroutines that need to be dead-ended. However, 
  2856. you may find it easier to debug a long script that has such 
  2857. subroutines if you use a "jmp" command at those points to bring 
  2858. all subroutines to a common exit point.
  2859.  
  2860. Parameters:
  2861.  
  2862.  none
  2863.  
  2864. Examples:
  2865.  
  2866.  >end|
  2867.  
  2868.  >L: label_1|
  2869.  >ifi $A "failure" jmp main_exit|
  2870.  >ifi $A "no call" jmp main_exit|
  2871.  ...
  2872.  >L: main_exit|
  2873.  >end|
  2874.  
  2875.  
  2876.  
  2877.  
  2878. - QUITTING FLASH
  2879.  
  2880. Command:
  2881.  
  2882.  >xd
  2883.  
  2884. (exit to the desktop)
  2885.  
  2886. Action:
  2887.  
  2888. Stops the DO script and forces Flash to quit. All variables 
  2889. that had been set will be lost when Flash ends unless you save 
  2890. them. Use SAVEVARS.DO, included with this documentation, to 
  2891. save variables before the "xd" command is executed.
  2892.  
  2893. Parameters:
  2894.  
  2895.  none
  2896.  
  2897. Examples:
  2898.  
  2899.  >xd|
  2900.  
  2901.  >L: quit_to_desktop|
  2902.  >do savevars.do|
  2903.  >xd|
  2904.  
  2905.  
  2906.  
  2907. - MAKING FLASH DO SOMETHING ON STARTUP
  2908.  
  2909. Command:
  2910.  
  2911.  >au
  2912.  
  2913. (auto startup command)
  2914.  
  2915. Action:
  2916.  
  2917. Places a command in Flash's memory that will be executed before 
  2918. any other commands when Flash loads -- but only if you save 
  2919. Flash's configuration file before quitting that session of 
  2920. Flash. (See example below.) You can have multiple commands, if 
  2921. they are properly separated.
  2922.  
  2923. Parameters:
  2924.  
  2925.  [any command] [any filespec]
  2926.  
  2927. (The parameters that follow the "au" command cannot be longer 
  2928. than 19 characters long, including spaces.)
  2929.  
  2930. Examples:
  2931.  
  2932.  >au do makevars.do|
  2933.  
  2934. (runs MAKEVARS.DO on startup, to restore variables)
  2935.  
  2936.  
  2937.  >au vi c:\help.txt|
  2938.  
  2939. (shows a help file as soon as Flash runs)
  2940.  
  2941.  
  2942.  >au ty Hello!|
  2943.  
  2944. (types "Hello!" on the screen when Flash runs)
  2945.  
  2946.  
  2947.  >au b2|>menu|
  2948.  
  2949. (rings a bell, then shows the Flash GEM menu when Flash runs)
  2950.  
  2951.  
  2952.  
  2953. - GETTING HELP
  2954.  
  2955. Command:
  2956.  
  2957.  >he
  2958.  
  2959. (help)
  2960.  
  2961. Action:
  2962.  
  2963. Drops Flash's Help window down on the screen and halts script 
  2964. execution while the Help window is shown. The Help window will
  2965. stay there forever if you do not remove it manually, so do not 
  2966. use this command in a script that runs unattended. Pressing the
  2967. [undo] key removes the Help window.
  2968.  
  2969. Example:
  2970.  
  2971.  >he|
  2972.  
  2973.  
  2974.  
  2975. - ACTIVATING THE PRINTER
  2976.  
  2977. Command:
  2978.  
  2979.  >pr [...]
  2980.  
  2981. (printer)
  2982.  
  2983. Action:
  2984.  
  2985. Echoes text that is being captured from the modem port to the 
  2986. printer port. If the printer is not on, Flash will continue 
  2987. execution anyway. Consider a printer buffer (a software buffer 
  2988. such as the Codehead SPOOLER.PRG or a hardware buffer) if you
  2989. plan to use the "pr" command often, since Flash can take input 
  2990. from the modem port much faster than most printers can print. A 
  2991. slow printer can force Flash to pause unduly.
  2992.  
  2993. Parameters:
  2994.  
  2995.  on
  2996.  
  2997.  off
  2998.  
  2999.  / (a toggle between on and off; not useful in scripts because 
  3000.  the prior state of the "pr" command may not be predictable)
  3001.  
  3002.  
  3003. Examples:
  3004.  
  3005.  >pr on|
  3006.  
  3007.  >pr off|
  3008.  
  3009.  >pr /|
  3010.  
  3011.  
  3012.  
  3013. - FREEING MEMORY FOR OTHER PROGRAMS
  3014.  
  3015. Command:
  3016.  
  3017.  >fr [...]
  3018.  
  3019. (free)
  3020.  
  3021. Action:
  3022.  
  3023. Frees a portion of the computer's memory for use by another 
  3024. program. This is especially handy if you have a desk accessory 
  3025. that refuses to run because it found insufficient memory. Memory
  3026. that has been freed cannot be "unfreed" back to Flash. Please
  3027. note that if you free up too much memory, Flash's capture buffer
  3028. will shrink to an unusable size.
  3029.  
  3030. Parameters:
  3031.  
  3032.  # (any number, representing the number of kilobytes of memory 
  3033. freed from Flash)
  3034.  
  3035. Examples:
  3036.  
  3037. >fr 200|
  3038.  
  3039. >fr 0060|
  3040.  
  3041. >fr 1024|
  3042.  
  3043.  
  3044.  
  3045. - SETTING UP THE TYPE-AHEAD BUFFER
  3046.  
  3047. Command:
  3048.  
  3049.  >ta
  3050.  
  3051. (type ahead)
  3052.  
  3053. Action:
  3054.  
  3055. Changes Flash's command line into a one-line type-ahead buffer. 
  3056. Note: Previous type-ahead lines can be brought back from 
  3057. Flash's memory by using the up-arrow key.
  3058.  
  3059. Parameters
  3060.  
  3061.  none
  3062.  
  3063. Example:
  3064.  
  3065.  >ta|
  3066.  
  3067.  
  3068.  
  3069. - OPENING THE STATUS DISPLAY WINDOW
  3070.  
  3071. Command:
  3072.  
  3073.  >ss
  3074.  
  3075. (status)
  3076.  
  3077. Action:
  3078.  
  3079. Opens the full-screen window of Flash's status display. While 
  3080. most of the configuration shown in the status window is 
  3081. duplicated in GEM menus, there are some that are shown only in 
  3082. the status window. The "au" (auto) command status is one of 
  3083. them. The only way to see if the copy of Flash that is running 
  3084. has an auto instruction is to open the status window.
  3085.  
  3086. Parameters:
  3087.  
  3088.  none
  3089.  
  3090. Example:
  3091.  
  3092. >ss|
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099. P A R T   5 :  A D V A N C E D   F L A S H   C O M M A N D S
  3100. ------------------------------------------------------------
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. - ALERTING THE USER AND ASKING FOR A PRE-PROGRAMMED RESPONSE
  3107.  
  3108. Command:
  3109.  
  3110.  >al [...]
  3111.  
  3112. (alert box)
  3113.  
  3114. Action:
  3115.  
  3116. Places a GEM alert box on the screen and pauses for mouse or 
  3117. keyboard response to one, two or three brief choices. The alert 
  3118. box can have one, two or three boxed choices called radio buttons
  3119. (mutually exclusive choices, like the station buttons on a car
  3120. radio), and those buttons can contain numbers or text. The area
  3121. above the buttons can have one, two or three lines of text. The
  3122. alert command can be written to provide a keyboard shortcut for a
  3123. default choice; the default button, if any, is surrounded by a
  3124. thick box, and can be chosen pressing [return]. However, the
  3125. mouse can always be used to click on one of the buttons whether
  3126. or not a default is given.
  3127.  
  3128. Parameters:
  3129.  
  3130.  "[#][text1|text2|text3][button text1|text2|text3]" $X #
  3131.  
  3132. The parameters must have quotation marks and brackets as shown.
  3133. They are divided into sections. The first is the icon type, if
  3134. any, that is displayed within the alert box. Icon 0 is no icon,
  3135. 1 is an exclamation mark, 2 is a question mark and 3 is a stop
  3136. sign. Any single digit less than 1 or greater than three equals
  3137. no icon.
  3138.  
  3139. The second section, also in brackets, can be divided into three
  3140. parts. It is the text of the alert box, with the "|" symbol
  3141. marking the end of line 1 and line 2. (Line 3 does not need the
  3142. "|" symbol.) You may have, at most, 30 characters (including
  3143. spaces) in two of the parts; the third can't have more than about
  3144. 25 or so depending on what else is in the alert box. (The alert
  3145. command must be contained on one line. Flash can't handle a
  3146. command line more than 96 characters wide, including the command
  3147. itself, the space after the command, the "|" at the end and the
  3148. parameters in between.) Play around with sample alert boxes to
  3149. see how much you can place in the box safely before you write any
  3150. alerts for normal scripts.
  3151.  
  3152. The third section, placed within brackets also, contains the
  3153. button texts. You must have at least one button, although the
  3154. "text" can be blank or can be a graphic character from the ST/TT
  3155. keyboard, such as a [control-B] character. The maximum length
  3156. of a button text is 10 characters.
  3157.  
  3158. The variable ($X in the generic example above) can be any letter,
  3159. uppercase or lowercase, and is optional. If a variable is
  3160. present, the text in the button that the user selects will be
  3161. placed in the variable. Note that if you do NOT use a variable,
  3162. the action of the last section is unpredictable.
  3163.  
  3164. The last section, which is optional, should be "1", "2" or "3".
  3165. It controls which button becomes the default -- the one that
  3166. automatically will be selected if the user presses [return]. If
  3167. you use "0" or a number greater than 3, Flash does not act in a
  3168. predictable manner; Flash will either provide no default button
  3169. or will make one of the buttons the default based on which button
  3170. was used as a default the last time an alert box was shown.
  3171.  
  3172. Examples:
  3173.  
  3174.  >al "[1][File exists.|Overwrite it anyway?][Yes|No]" $A 2|
  3175.  
  3176.  >al "[2][Choose a drive|to save the file to.][A:|B:|C:]" $X 1|
  3177.  
  3178.  >al "[3][WARNING!|Modem is not responding!][OK|QUIT]" $M 2|
  3179.  
  3180.  
  3181.  
  3182.  
  3183. - GETTING ANY TEXT STRING FROM THE USER
  3184.  
  3185. Command:
  3186.  
  3187.  >qu [...]
  3188.  
  3189. (query)
  3190.  
  3191. Action:
  3192.  
  3193. Shows an alert box that prompts the user for up to 40 characters
  3194. of input from the keyboard. The box can contain a short text of
  3195. up to three lines that gives instructions for the user. This
  3196. text is the first parameter of the command.
  3197.  
  3198. The input is placed in a variable, the second parameter. The
  3199. user input can include ST/TT graphics characters in addition to
  3200. letters and numbers.
  3201.  
  3202. Parameters:
  3203.  
  3204. The two parameters are the text of the query and the variable to
  3205. place the input in. Although the query box is large enough to
  3206. contain a lot of text, Flash's limit on the length of command
  3207. lines will keep you from writing more than about 90 characters.
  3208. Each line of text can be up to 40 characters long and must end
  3209. with a "|" symbol, and the entire text must be in quotes.
  3210.  
  3211. Examples:
  3212.  
  3213.  >qu "Please type your full name:" $N|
  3214.  
  3215.  >qu "What BBS telephone number|do you want to call?" $X|
  3216.  
  3217.  >qu "Please type the password|for access to this script:" $P|
  3218.  
  3219.  
  3220.  
  3221.  
  3222. - COMBINING USER INPUT WITH STRING MANIPULATION
  3223.  
  3224. Context examples:
  3225.  
  3226. 1. A simple request for a number to dial.
  3227.  
  3228. The variable "X" is checked to make sure it is not blank, and
  3229. the contents of the variable are then passed to the dialing
  3230. command. This routine makes no attempt to check to see if the
  3231. contents of the variable are indeed numbers; this can be done in
  3232. Flash, but only with a great deal of effort. (A partial example
  3233. of how to do that is shown below.)
  3234.  
  3235.  
  3236. >L: getnumber|
  3237. >qu "What BBS telephone number|do you want to call?" $X|
  3238. >if ~X jmp getnumber|
  3239. >ty  You typed: $X.|
  3240. >ty|
  3241. >ty Dialing $X...|
  3242. >ty|
  3243. >di #$X|
  3244.  
  3245.  
  3246. 2. A way to check for numbers in a variable.
  3247.  
  3248. Flash does not have any method of treating variables as numerics
  3249. instead of simple text strings, so you need to check for the
  3250. presence of at least ONE number with a routine like this:
  3251.  
  3252. >L: getnumber|
  3253. >qu "What BBS telephone number|do you want to call?" $X|
  3254. >if ~X jmp getnumber|
  3255. >ifi $X "0" jmp ok|
  3256. >ifi $X "1" jmp ok|
  3257. >ifi $X "2" jmp ok|
  3258. >ifi $X "3" jmp ok|
  3259. >ifi $X "4" jmp ok|
  3260. >ifi $X "5" jmp ok|
  3261. >ifi $X "6" jmp ok|
  3262. >ifi $X "7" jmp ok|
  3263. >ifi $X "8" jmp ok|
  3264. >ifi $X "9" jmp ok|
  3265. >ty  You did not type a number!|
  3266. >ty|
  3267. >jmp getnumber|
  3268. >L: ok|
  3269. >ty  You typed: $X.|
  3270. >ty|
  3271. >ty Dialing $X...|
  3272. >ty|
  3273. >di #$X|
  3274.  
  3275.  
  3276. 3. A way to make sure two variables are exactly the same.
  3277.  
  3278. In one of the examples above, the user is asked for a password.
  3279. The standard method of checking one variable against another is
  3280. the "ifi" command ("ifin" -- meaning "if the contents of this
  3281. variable are contained in the other one"). But "ifi" checks only
  3282. for a non-exclusive match; Flash just checks to see if the string
  3283. in one variable is *included* in the other one.
  3284.  
  3285. In other words, a variable containing the string "John" will
  3286. pass an "ifi" comparison against a variable containing the string
  3287. "Johnson" and a variable containing the string "Johnny on the
  3288. Spot." If you want to make an exact match, you have to resort to
  3289. some string manipulation.
  3290.  
  3291. That's not puppet talk; it's the way you can turn a text string
  3292. entered by the user into something else. The easiest way is to
  3293. add front and back delimiters to the string. They mark the
  3294. beginning and the end, so you can compare another string for an
  3295. exact match for content and length.
  3296.  
  3297. Here's how that's done. In the example below, variable X takes
  3298. over from variable P for password checks. The actual password is
  3299. stored in a file called PASSWORD.DAT, which consists of all the
  3300. passwords, one to a line. The "inp" command reads each line of the
  3301. PASSWORD.DAT file into a variable, and that variable is checked
  3302. against the user input. (Note that the user gets only a few
  3303. chances to type the password right. This is done by a loop that
  3304. increments a counter. When the counter reaches as certain value,
  3305. the routine bounces the user out of the script.)
  3306.  
  3307. >L: start|
  3308. >$C 0|
  3309. >jmp getpw|
  3310. >L: RetryLoop|
  3311. >ifi $C "0" jmp increment0|
  3312. >ifi $C "1" jmp increment1|
  3313. >ifi $C "2" jmp increment2|
  3314. >ifi $C "3" ty  Too many failures! Script aborted.|
  3315. >ifi $C "3" end|
  3316. >L: getpw|
  3317. >qu "Please type the password|for access to this script:" $P|
  3318. >if ~P jmp getpw|
  3319. >$X &$P&
  3320. >** The user string now begins and ends with the "&".|
  3321. >op password.dat|
  3322. >if ~op ty  Password data corrupted! Please run SETUP.DO!|
  3323. >if ~op end|
  3324. >L: InputLoop|
  3325. >inp $A|
  3326. >if eof jmp NotFound|
  3327. >** If the end-of-file mark is reached before a match is made,|
  3328. >** the password is not there.|
  3329. >$B &$A&|
  3330. >ifi $B $X jmp pwOK|
  3331. >jmp InputLoop|
  3332. >** password not found routine|
  3333. >L: NotFound|
  3334. >ty  Password not found. Please notify the system programmer.|
  3335. >ty|
  3336. >end|
  3337. >** counter increment routine|
  3338. >L: increment0|
  3339. >$C 1|
  3340. >jmp getpw|
  3341. >L: increment1|
  3342. >$C 2|
  3343. >jmp getpw|
  3344. >L: increment2|
  3345. >$C 3|
  3346. >jmp getpw|
  3347. >** password ok routine|
  3348. >L: pwOK|
  3349. >ty Password accepted. Launching script...|
  3350. >ty|
  3351. >do anyscript.do|
  3352. >end|
  3353.  
  3354.  
  3355.  
  3356.  
  3357. Handling text input and text strings
  3358. ------------------------------------
  3359.  
  3360.  
  3361.  
  3362. - GETTING REMOTE INPUT
  3363.  
  3364. Command:
  3365.  
  3366.  >ge [...]
  3367.  
  3368. (get)
  3369.  
  3370. Action: Gets a text string from the other computer across the 
  3371. modem port. The maximum length of the string is a little over 
  3372. 100 characters. It's important to note that the "ge" command 
  3373. recognizes a carriage return as the end of the string, but does 
  3374. not include it in the string that it saves in Flash's input 
  3375. buffer. This means that a bare carriage return sent from the 
  3376. other computer will be interpreted as an empty string. Flash 
  3377. *can* find empty strings, however, as we shall see below.
  3378.  
  3379. Parameters:
  3380.  
  3381.  $X (any variable)
  3382.  
  3383. Example:
  3384.  
  3385. >ge $B|
  3386.  
  3387. Context example:
  3388.  
  3389. >se "Please type your name.|"|
  3390. >ge $N|
  3391.  
  3392.  
  3393.  
  3394.  
  3395. - CHECKING FOR THE SPECIFIC CONTENTS OF A VARIABLE
  3396.  
  3397. Command:
  3398.  
  3399. >ifi [...] [...] [...]
  3400.  
  3401. (ifin)
  3402.  
  3403. Action:
  3404.  
  3405. Looks at a text string contained in a variable to see if there 
  3406. is a matching string. If it finds one, Flash executes the 
  3407. command given after the string comparison. The string does not 
  3408. need to be a complete match for the full text of the variable's
  3409. string; all Flash does is check for its inclusion (thus the name
  3410. "ifin" in the full spelling of this command, which means "if in
  3411. string X you find string Y, you've got a match").
  3412.  
  3413. This means that the string "Harry" is contained in the string 
  3414. "Harry's Bar and Grill," as is the string "ar" (in fact, it is 
  3415. in there twice). But the string "Harry's Bar and Grill" is *not* 
  3416. contained in the string "Harry". Be careful to place your 
  3417. comparisons properly so that the strings are compared the way 
  3418. you want them to be. The "ifi" command always works in this 
  3419. order: If in string 1 is string 2, execute a command.
  3420.  
  3421. Flash does not check for the case of the string characters in 
  3422. the comparison. "The" is the same as "the" and "tHe" and so on.
  3423.  
  3424.  
  3425. Parameters:
  3426.  
  3427.  First parameter: $X (any variable)
  3428.  
  3429.  Second parameter: $X (any variable) or any text string
  3430.  
  3431.  Third parameter: any Flash command
  3432.  
  3433.  
  3434. Examples:
  3435.  
  3436. >ifi $X "Yes" jmp showmenu|
  3437.  
  3438. >ifi $Y "Monday" al "[1][Do weekly backups?][Yes|No]" $Z 1|
  3439.  
  3440.  
  3441. Context example:
  3442.  
  3443. >L: top|
  3444. >qu "Type the name of the script:" $X|
  3445. >ifi $X ".do" jmp nameOK|
  3446. >al "[3][""DO"" extender missing!Try again?][Yes|No]" $Y 1|
  3447. >ifi $Y "Yes" jmp top|
  3448. >do $X|
  3449.  
  3450.  
  3451.  
  3452. - TESTING FOR EMPTY VARIABLES AND SUCCESSFUL COMMANDS
  3453.  
  3454. Command:
  3455.  
  3456.  >if [~] [...] [...]
  3457.  
  3458.  
  3459. Action:
  3460.  
  3461. The "if" command is quite powerful. In essence, it tests a 
  3462. condition. One use is to test a variable.
  3463.  
  3464. Tests for *any* string in a variable, or for a null in a 
  3465. variable. The first parameter (or, more properly, a command 
  3466. switch) is the "~" symbol, which inverts the command, so that it 
  3467. checks for a null.
  3468.  
  3469. A null is an empty variable, also called an empty string. You can
  3470. create a nulled variable yourself, or a variable can become
  3471. nulled if Flash is waiting for user input and receives only a
  3472. carriage return.
  3473.  
  3474. Unlike all other Flash commands that use variables, the "if" 
  3475. command is *not* followed by the "$X" designation of a variable, 
  3476. but only by the character representing the variable, without the 
  3477. dollar sign. Thus you have "if X" and *not* "if $X".
  3478.  
  3479.  
  3480. Parameters:
  3481.  
  3482.  Optional switch: ~ (turns "if" to "if not")
  3483.  
  3484.  First parameter: X (any variable, without the "$")
  3485.  
  3486.  Second parameter: any Flash command
  3487.  
  3488.  
  3489. Examples:
  3490.  
  3491. >if X se "Thanks for the response!|"|
  3492.  
  3493. >if ~D ty Date not set.|
  3494.  
  3495.  
  3496. Context example:
  3497.  
  3498. >L: top|
  3499. >se "Please type your name.|"|
  3500. >ge $N|
  3501. >if ~N se "You must type your name.|"|
  3502. >if ~N jmp top|
  3503. >se "You typed: $N.|"|
  3504. >se "Is this correct? (Y/n): |"|
  3505. >ge $C|
  3506. >if ~C se "Sorry, we must log you off...|"|
  3507. >if ~C hg|
  3508. >ifi $C "Y" jmp nameOK|
  3509. >jmp top|
  3510.  
  3511.  
  3512.  
  3513. The other uses of the "if" command test for the successful 
  3514. completion of a command or a condition. The commands all use 
  3515. "if" the same way, with the "~" used to invert the meaning.
  3516.  
  3517. Not all commands or conditions can be tested; here are the ones
  3518. that are included:
  3519.  
  3520. ca (carrier; checks for presence of modem carrier)
  3521. >if ca [command]
  3522. >if ~ca [command]
  3523.  
  3524. di (dial; checks for completion of dial command)
  3525. >if di [command]
  3526. >if ~di [command]
  3527.  
  3528. eof (end of file; used when inputting data)
  3529. >if eof [command]
  3530. >if ~eof [command]
  3531.  
  3532. op (open; checks for presence of a file)
  3533. >if op [command]
  3534. >if ~op [command]
  3535.  
  3536. ul (upload; used to tell if an upload was OK)
  3537. >if ul [command]
  3538. >if ~ul [command]
  3539.  
  3540. wa (wait for a string; checks if the string was found)
  3541. >if wa [command]
  3542. >if ~wa [command]
  3543.  
  3544.  
  3545.  
  3546.  
  3547. Simple examples of The "if" command
  3548. -----------------------------------
  3549.  
  3550.  
  3551. Usually, the "if" command is thought of as essential for remote 
  3552. DO scripts -- those that run while you are asleep, for example, 
  3553. as you might want to do when calling a long-distance BBS or a 
  3554. busy telecomm service.
  3555.  
  3556. But it can also be very useful in scripts that are running when 
  3557. you are at the console. The "if" command can be made to check on 
  3558. a number of things that your computer can do better (or at least 
  3559. faster) than you can.
  3560.  
  3561. Here is a simple dialing routine using "if" with the "di" 
  3562. command:
  3563.  
  3564. >L: makecall|
  3565. >di #123-4567|
  3566. >if ~di al "[1][Dial failed!|Try again?][Yes|No]" $X 1|
  3567. >ifi $X "Yes" jmp makecall|
  3568.  
  3569.  
  3570. Here is a routine that makes sure your modem still has a carrier 
  3571. before it tries an upload or download:
  3572.  
  3573. >if ca ul myfile.ext|
  3574.  
  3575.  
  3576. Here is a way to make Flash repeat an upload attempt if 
  3577. necessary. It also checks for a carrier and checks to see if the 
  3578. "wa" command failed:
  3579.  
  3580. >L: makeupload|
  3581. >se "U|"|>** upload command sent to a BBS.|
  3582. >wa "Ready"|>** wait for string from BBS.|
  3583. >if ~wa jmp warning|
  3584. >if ca ul myfile.ext|
  3585. >if ~ul jmp tryagain|
  3586. >end|
  3587. >L: tryagain|
  3588. >pa 5|>** pause for any length of time to let BBS react.|
  3589. >se "U|"|
  3590. >wa "Ready"|
  3591. >if ~wa jmp warning|
  3592. >if ca ul myfile.ext|
  3593. >if ~ul jmp warning|
  3594. >end|
  3595. >L: warning|
  3596. >al "[3][Upload attempt failed!|Try again?][Yes|No] $Y 2|
  3597. >ifi $Y "Yes" jmp makeupload|
  3598. >end|
  3599.  
  3600.  
  3601.  
  3602.  
  3603. Checking to see if a file exists
  3604. --------------------------------
  3605.  
  3606.  
  3607. The "op" (open) command has two primary uses when dealing with 
  3608. disk files. The first is to open a file so that the contents can 
  3609. be read line-by-line. We'll get to that shortly, but we should 
  3610. first see how "op" can be used to do nothing more than confirm 
  3611. that a file exists. This is done through the "if" command. Here 
  3612. is an example:
  3613.  
  3614. >op myfile.ext|
  3615. >if op al "[1][File exists!|Overwrite it anyway?][Yes|No] $X 2|
  3616. >ifi $X "Yes" sa ca myfile.ext|
  3617.  
  3618.  
  3619. The same technique can be used to see if a folder exists. Flash 
  3620. cannot see folders that way it can see files, but that shouldn't 
  3621. get in the way if you intentionally test for the presence of a 
  3622. folder by trying to save a file to that folder. Here's an 
  3623. example, which uses the "log" command to create a small text 
  3624. string in the capture buffer and then tries to save that string 
  3625. to a file:
  3626.  
  3627. >$X|>** Var. X is nulled so it can be used below.|
  3628. >ca on|
  3629. >ca cl|
  3630. >log "This is a string of test data.|"|
  3631. >sa ca foldname\test.dat|>** any folder name can be used.|
  3632. >op foldname\test.dat|
  3633. >if ~op al "[1][Folder does not exist!][Sorry!]" $X 0|
  3634. >ifi $X "Sorry" end|
  3635. >al "[1][Folder located!][Thanks!]" $X 0|
  3636. >ca cl|
  3637. >end|
  3638.  
  3639.  
  3640. A routine like the one above could get a lot fancier. The only 
  3641. thing Flash cannot do unaided is create a folder. It can easily 
  3642. find any folders, however, so it wouldn't hurt to make sure you 
  3643. have various folders already created, even if they are empty.
  3644.  
  3645.  
  3646.  
  3647.  
  3648. Getting Flash to read data from a file
  3649. --------------------------------------
  3650.  
  3651.  
  3652. Reading data from a file is a good way of making Flash check the 
  3653. contents line-by-line. The process actually goes fairly quickly 
  3654. if the file is read from a fast hard disk or from a ramdisk. If 
  3655. your computer has a lot of memory, you can make the process even 
  3656. faster by loading the data file into the capture buffer and 
  3657. reading each line from the buffer.
  3658.  
  3659. Please note that the data file should be a *formatted* text 
  3660. whenever possible -- in other words, a file just like the one 
  3661. you are reading, with lines that do not exceed the screen width. 
  3662. Lines that are longer than about 90 characters are truncated by 
  3663. Flash (the ends are cut off), which will keep Flash from seeing 
  3664. whatever was located past that point on each line.
  3665.  
  3666. Why would you want to have Flash read a data file? There are 
  3667. quite a few good reasons. If you regularly run a DO script (or a 
  3668. series of scripts) while Flash is running unattended, you may 
  3669. want to have Flash save an error.log to disk. Later, Flash can 
  3670. automatically check the error.log for various entries, alerting 
  3671. you if it finds some that are serious problems.
  3672.  
  3673. A sexier use might be to have Flash automatically read a message 
  3674. file for certain key words. In other words, you could create a 
  3675. script that turns Flash into a sort of database manager, 
  3676. alerting you to text files that you may want to read (and saving 
  3677. you the trouble of paging through text files that aren't worth 
  3678. reading).
  3679.  
  3680. The basic routine that you *must* (and I mean *must*!) use 
  3681. follows this pattern:
  3682.  
  3683. >op filename.ext|
  3684. >if ~op end|
  3685. >L: looptop|
  3686. >in $X|
  3687. >if eof jmp loopend|
  3688. >ifi $X "target string" jmp loopend|
  3689. >jmp looptop|
  3690.  
  3691. First you must open the file. Then you must have a label at the 
  3692. top of the input loop. The next command must be the "in" (input) 
  3693. command, using a variable to store the data. The very next 
  3694. command *absolutely must* be a check for the end-of-file marker; 
  3695. otherwise, your loop could go on forever. The next line uses the 
  3696. "ifi" (ifin) command to check for the presence of the string you 
  3697. are looking for in the data file. If the string is not found, 
  3698. Flash loops back to the top and inputs the next line and starts 
  3699. the search again.
  3700.  
  3701. You can, of course, have Flash search for more than one target 
  3702. string. Obviously, with 26 possible variables, you can specify 
  3703. 26 separate target strings. It's even possible to search for 
  3704. more than 26, by manipulating the strings. (I'll let you work 
  3705. that out for yourself as a little challenge. Write to me if you 
  3706. manage it in a clean fashion -- no thousand-line DO files, 
  3707. please!)
  3708.  
  3709. Here's the same routine as the one above, with multiple target 
  3710. strings:
  3711.  
  3712.  
  3713. >op filename.ext|
  3714. >if ~op end|
  3715. >L: looptop|
  3716. >in $X|
  3717. >if eof jmp loopend|
  3718. >ifi $X "target string 1" jmp loopend|
  3719. >ifi $X "target string 2" jmp loopend|
  3720. >ifi $X "target string 3" jmp loopend|
  3721. >ifi $X "target string 4" jmp loopend|
  3722. >ifi $X "target string 5" jmp loopend|
  3723. >ifi $X "target string 6" jmp loopend|
  3724. >jmp looptop|
  3725.  
  3726.  
  3727. After you've set up Flash to check for target strings in a data 
  3728. file, what do you do with them? You'll need to create another 
  3729. routine, or perhaps a separate DO script, to process the 
  3730. information that Flash picked up from the data file. In the 
  3731. example below, I'll assume that you want Flash to check the 
  3732. current message download from a BBS for any mention of the ST, 
  3733. the TT or Atari. This will be a rudely basic example, and you'll 
  3734. probably want to make it a lot more specific.
  3735.  
  3736. First, here's a tip on how to make sure Flash finds the 
  3737. character strings you are really looking for. The precise string 
  3738. you are looking for should be delineated in some way, probably 
  3739. by placing a space in front of and behind it. For example, if you
  3740. want Flash to find the string "ST" in the data file, you should
  3741. list that string twice in your "in" command -- once with a space
  3742. in front of it, and once with a space behind it. This will keep
  3743. Flash from finding the two letters "st" within such words as
  3744. "fast" or "stupid" (I know, who would dare put the word "stupid"
  3745. in a BBS text file? But you never know....)
  3746.  
  3747. Once the file has been checked, you should branch to a routine 
  3748. that makes use of the variables. This is what we'll be doing 
  3749. below.
  3750.  
  3751. (In this routine, the string "Atari" is specific enough, so we 
  3752. won't place spaces around it.)
  3753.  
  3754.  
  3755. >$S|
  3756. >$T|>** These must be nulled at the start.|
  3757. >$A|
  3758. >op bbsmsg.txt|
  3759. >if ~op end|
  3760. >L: looptop|
  3761. >in $X|
  3762. >if eof jmp loopend|
  3763. >ifi $X " ST" jmp st_found|
  3764. >ifi $X "ST " jmp st_found|
  3765. >L: tt_search|
  3766. >ifi $X " TT" jmp tt_found|
  3767. >ifi $X "TT " jmp tt_found|
  3768. >L: atari_search|
  3769. >ifi $X "Atari" jmp atari_found|
  3770. >jmp looptop|
  3771. >L: st_found|
  3772. >$S the ST|
  3773. >jmp tt_search|
  3774. >L: tt_found|
  3775. >$T the TT|
  3776. >jmp atari_search|
  3777. >L: atari_found|
  3778. >$A Atari in general|
  3779. >L: loopend|
  3780. >if S jmp combine_vars|
  3781. >if T jmp combine_vars|
  3782. >if A jmp combine_vars|
  3783. >$B No mention of the ST, the TT or Atari in general found.|
  3784. >jmp store_B|
  3785. >L: combine_vars|
  3786. >if ~A jmp no_A|
  3787. >if ~T jmp no_T|
  3788. >$B Search found mentions of $S, $T and $A.|
  3789. >jmp store_B|
  3790. >L: no_A|
  3791. >if ~T jmp no_T|
  3792. >$B Search found mentions of $S and $T.|
  3793. >jmp store_B|
  3794. >L: no_T|
  3795. >$B Search found mentions of $S.|
  3796. >L: store_B|
  3797. >ca on|
  3798. >ca cl|
  3799. >log $B|
  3800. >log|
  3801. >sa ca msgalert.dat|
  3802. >ca cl|
  3803. >vi msgalert.dat|
  3804. >** msgalert.dat is shown on the screen.|
  3805. >end|
  3806.  
  3807.  
  3808. You could try many varieties of the script above. One variation 
  3809. would be to have Flash show you each line of text that contains 
  3810. the target string(s). All you'd need to add to do that are these 
  3811. two lines right after the "xx_found" labels:
  3812.  
  3813. >ty $X
  3814. >ty|
  3815.  
  3816.  
  3817. Or you could place all the lines of text that contain the target 
  3818. strings into Flash's buffer, and then save the buffer. To do 
  3819. that, use this line in place of the two lines above:
  3820.  
  3821. >log $X|
  3822.  
  3823. and then save the capture buffer when the loop is finished.
  3824.  
  3825.  
  3826.  
  3827.  
  3828. Using a data file to check your drives
  3829. --------------------------------------
  3830.  
  3831.  
  3832. By writing a script that does nothing except write a line of 
  3833. data to a file, you can have Flash try to open the file on each 
  3834. drive in your computer's system. Files that fail to open don't 
  3835. exist -- and that means there must be some sort of trouble with 
  3836. the drive. Here's an example:
  3837.  
  3838.  
  3839. >ca on|
  3840. >ca cl|
  3841. >log This is a line of test data.|
  3842. >sa ca a:\test.dat|
  3843. >op a:\test.dat|
  3844. >if ~op al "[1][Trouble with Drive A:!][Thanks!]" $X 0|
  3845. >sa ca b:\test.dat|
  3846. >op b:\test.dat (etc..)
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853. P A R T   6 :  F L A S H ' S   H I D D E N   F E A T U R E S
  3854. ------------------------------------------------------------
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860. Flash has a file copier -- and it's not just for texts
  3861. ------------------------------------------------------
  3862.  
  3863.  
  3864. Flash's text storage area is called the capture buffer. Any time
  3865. you type something into the text editor, you are using the
  3866. capture buffer. You can also load a text from a disk file into
  3867. the capture buffer, and of course you can save text that is
  3868. coming across the modem port into the buffer.
  3869.  
  3870. The "sa" (save) command allows you to save whatever is in the
  3871. capture buffer to a disk file. Since the capture buffer is used
  3872. by the text editor, most users probably assume that they cannot
  3873. use the capture buffer to hold program files. And few may have
  3874. understood that the capture buffer can also be used to copy
  3875. software.
  3876.  
  3877. In other words, you can load a binary file (a program) -- not
  3878. just a text file -- into the capture buffer and then save the
  3879. buffer to another location. If you have a large enough capture
  3880. buffer, you can use it to copy even very large programs.
  3881.  
  3882. I know someone out there is going to insist that this sort of
  3883. thing can't possibly work. The standard argument I've heard from
  3884. Flash users who haven't tried this method is that Flash's capture
  3885. buffer has a built-in word-wrap, and this word-wrap will somehow
  3886. mess up the binary file. They've suggested that it might work if
  3887. Flash's word-wrap is turned off.
  3888.  
  3889. But no matter what the setting of word-wrap, Flash does not try
  3890. to wrap (place carriage returns into) binary data that is loaded
  3891. into the buffer. This has nothing to do with binary data; it's
  3892. just that Flash does not wrap *any* data that is placed in the
  3893. buffer. Word-wrap has no effect until you either start typing or
  3894. press F10 (the reformat key). If you use the capture buffer
  3895. merely as a storage area, no characters or data in the original
  3896. file are altered in any way, and the saved version of the buffer
  3897. is exactly the same as the original file.
  3898.  
  3899. Here's an example of using Flash to copy the program ARC.TTP
  3900. from one folder to another:
  3901.  
  3902. >ca on|
  3903. >ca cl|
  3904. >lo ca c:\archive\arc.ttp|
  3905. >sa ca d:\temp\arc.ttp|
  3906. >ca cl|
  3907.  
  3908. Of course, you can also change the name of the file when you copy
  3909. it. And that means that you can use Flash to rename files of any
  3910. kind merely by loading a file into the capture buffer, saving it
  3911. with a new filename, and then killing the original file. Here is
  3912. an example:
  3913.  
  3914. >ca on|
  3915. >ca cl|
  3916. >lo ca c:\flash\funckey.def|
  3917. >sa ca c:\flash\bbsfkey.def|
  3918. >ca cl|
  3919. >ki c:\flash\funckey.def|
  3920.  
  3921.  
  3922.  
  3923. Flash has "gosubs" just like BASIC and C
  3924. ----------------------------------------
  3925.  
  3926.  
  3927. One of the biggest complaints about Flash from users who have
  3928. created their own Flash DO files is the apparent lack of a
  3929. "gosub" facility. A "gosub" is a variation on the familiar
  3930. "goto," which in Flash is called a "jmp." A "jmp" command forces
  3931. Flash to find its next instruction not at the following command
  3932. but at a label anywhere else in the DO script. It looks like
  3933. this:
  3934.  
  3935. >jmp SomeLabel|
  3936. ...
  3937. >L: SomeLabel|
  3938.  
  3939. The problem with all "goto" commands, including Flash's "jmp," is
  3940. that the program does not automatically return to the point where
  3941. the "goto" instruction was issued. A "jmp" does not tell Flash to
  3942. go to another instruction and then return to the place it had
  3943. been; rather, it is a doorway, so to speak, that only opens in
  3944. one direction (unless, of course, you write the script with a
  3945. return "jmp" back to the original location -- something that can
  3946. be chancy if you're not really careful).
  3947.  
  3948. A "gosub" is a goto-and-return command, used to access such
  3949. things as subroutines that work with the main script. Here's a
  3950. simple one, an imaginary Flash "gosub" that calls up a help
  3951. screen any time a user presses <H>. You'd want a "gosub" used
  3952. here because the script should not have to proceed to any other
  3953. point except the "help" subroutine:
  3954.  
  3955. >L: top|
  3956. >al "[2][Xmodem transfer,|Quit or Help?][Xmodem|Quit|Help|" $X 0|
  3957. >ifi $X "Xmodem" jmp XmodemXfer|
  3958. >ifi $X "Quit" jmp Quit|
  3959. >ifi $X "Help" gosub HelpScreen|
  3960. >if ~X jmp top|
  3961.  
  3962. Another such subroutine might be a date-setting procedure. When
  3963. the main script is running, it can be programmed to check for a
  3964. current date; if it does not find one, the main script would then
  3965. use a "gosub" to branch to a date-setting subroutine, which would
  3966. return to the next command in the main script after it had run.
  3967.  
  3968. It would look something like this, if Flash had a "gosub"
  3969. (variable D would hold the date):
  3970.  
  3971. >mo ansi|
  3972. >ba 2400|
  3973. >if ~D gosub DateSet|
  3974. >di starbbs|
  3975.  
  3976. Here's another example, using an imaginary "gosub" to look for
  3977. caller passwords in a simple Flash-based BBS:
  3978.  
  3979. >L: top|
  3980. >hg|>** hang up|
  3981. ATS0=1|
  3982. >** send answer command to modem (on first ring)|
  3983. >wa "CONNECT"|
  3984. >send " Welcome to the Flashland BBS.|"|
  3985. >send "Please type your password: "|
  3986. >get $P|
  3987. >if ~P jmp top|>** reset modem if no response|
  3988. >gosub CheckPW|
  3989. >ifi $C "password OK" send "|You are now on line.|"|
  3990. >ifi $C "password OK" jmp mainmenu|
  3991. >send "|Password not found!|"|
  3992. >gosub GetNewPW|
  3993. >L: mainmenu|
  3994. ...
  3995.  
  3996. In each case above, Flash actually *does* have a gosub that can
  3997. be used. In fact, there are two different ways of doing it. The
  3998. first involves spawning a new script that is executed from within
  3999. the current script. This uses the "do" command. Whenever another
  4000. DO file is executed from within a running DO file, the new script
  4001. is executed and then the command execution returns to the command
  4002. following the one that issued the "do" command -- a perfect
  4003. "gosub."
  4004.  
  4005. This method works very well, especially if the scripts are all
  4006. running from a fast hard drive. The primary drawback should be
  4007. obvious: Flash does not allow nested DO files past three levels,
  4008. so you should be careful to keep track of how many levels deep
  4009. you may be going when you nest any scripts.
  4010.  
  4011. There's another caution, too, which will be mentioned a little
  4012. later.
  4013.  
  4014. Here's another version of the first example given above, using a
  4015. nested DO file instead of the non-existent "gosub":
  4016.  
  4017. >L: top|
  4018. >al "[2][Xmodem transfer,|Quit or Help?][Xmodem|Quit|Help|" $X 0|
  4019. >ifi $X "Xmodem" jmp XmodemXfer|
  4020. >ifi $X "Quit" jmp Quit|
  4021. >ifi $X "Help" do help.do|
  4022. >if ~X jmp top|
  4023.  
  4024. And here is the second example above, using the "do" command as
  4025. a "gosub":
  4026.  
  4027. >mo ansi|
  4028. >ba 2400|
  4029. >if ~D do date.do|
  4030. >di starbbs|
  4031.  
  4032. Likewise, the third example would work fine if "do" commands were
  4033. used instead of "gosubs" where necessary.
  4034.  
  4035. The second way of getting "gosubs" in Flash is not used much,
  4036. judging from the scripts that I have seen. But it is quite
  4037. powerful, and does not have a nesting problem. It involves the
  4038. use of function-key strings -- commands that are inserted in
  4039. function keys 1 through 20 and called from a script using the
  4040. "go" command.
  4041.  
  4042. Whenever a "go" command is executed, the script continues at its
  4043. next command after the function-key string is passed to the
  4044. program. In actual execution, the "go" is a true "gosub."
  4045.  
  4046. What makes this even more useful is Flash's ability to program
  4047. function keys from within DO files themselves, using the "fk"
  4048. command. This means that the main script can set up a function
  4049. key in any way it wants, and then branch to it if needed.
  4050.  
  4051. To use this feature properly, you must understand how Flash
  4052. passes function-key strings to a function key. Because these
  4053. "fkey" commands are also script commands, you must be sure that
  4054. Flash does not execute them when it is merely loading them into
  4055. an fkey. The way to do it is to use single quote marks around the
  4056. entire fkey string; when Flash encounters a single quote mark, it
  4057. ignores all commands between that mark and the next one it comes
  4058. to. (Things can get complicated if you are also inserting quotes
  4059. into a function key, but Flash also has a way of getting around
  4060. that, as we'll see shortly.)
  4061.  
  4062. Let's change the first example above so that the "help"
  4063. subroutine is accessed through a function key. First, the fkey
  4064. must be set up; that's the second line in the example below.
  4065.  
  4066. >L: top|
  4067. >fk 1 '>$X|>vi help.txt|'|
  4068. >al "[2][Xmodem transfer,|Quit or Help?][Xmodem|Quit|Help|" $X 0|
  4069. >ifi $X "Xmodem" jmp XmodemXfer|
  4070. >ifi $X "Quit" jmp Quit|
  4071. >ifi $X "Help" go 1|
  4072. >if ~X jmp top|
  4073.  
  4074. A sharp-eyed Flash user may be able to notice that the same
  4075. effect might be achieved without using the equivalent of a
  4076. "gosub" in the example above, by changing one line and adding
  4077. another, while deleting the fkey loader, like this:
  4078.  
  4079. >L: top|
  4080. >al "[2][Xmodem transfer,|Quit or Help?][Xmodem|Quit|Help|" $X 0|
  4081. >ifi $X "Xmodem" jmp XmodemXfer|
  4082. >ifi $X "Quit" jmp Quit|
  4083. >ifi $X "Help" vi help.txt|
  4084. >ifi $X "Help" jmp top|
  4085. >if ~X jmp top|
  4086.  
  4087. But this method is not reliable once your commands become more
  4088. complicated. Using the "go" command is foolproof and should not
  4089. give you any trouble.
  4090.  
  4091. What about the problem of placing quote marks in commands when
  4092. you assign fkey strings from a DO file? Here's where this kind of
  4093. problem can arise: You may want your fkey to have quotes built
  4094. into the contents of the string, such as when you are assigning
  4095. an alert box to the function key. Alert box commands *must* have
  4096. quotes in them, as in the second line of the example above.
  4097.  
  4098. Here's how to do it. Use double quotes instead of single quotes
  4099. when you create the fkey string. In other words, place a double
  4100. quote in front of every double quote that you want to have Flash
  4101. pass through to the function key. Here's how it would look:
  4102.  
  4103. >ty  |
  4104. >fk 1 '>al ""[2][Xmodem transfer?][Xmodem|Quit]"" $X 0|'|
  4105. >go 1|
  4106. >ifi $X "Xmodem" jmp XmodemXfer|
  4107. >ifi $X "Quit" jmp Quit|
  4108.  
  4109. By the way, the same method works in any situation in which you
  4110. want to pass a quote mark through Flash without having it changed
  4111. or acted on (when you are logging text to Flash's capture buffer,
  4112. for example).
  4113.  
  4114.  
  4115.  
  4116. Flash can be more than a program; it can be a shell
  4117. ---------------------------------------------------
  4118.  
  4119.  
  4120. A shell is merely a program that runs other programs. The ST and
  4121. TT GEM desktops are shells, for example. But the most common
  4122. shells that advanced ST and TT users are likely to encounter are
  4123. command-line shells. An excellent shareware shell is
  4124. Tomshell.prg, which is distributed with STalker. Unix-like shells
  4125. are also common among some users.
  4126.  
  4127. Some shells let you set up function keys to run programs, and
  4128. others offer advanced batch-file capabilities.
  4129.  
  4130. Flash can do all that. All you need to do is try it.
  4131.  
  4132. To use Flash as a shell, run it from the GEM desktop and then set
  4133. up function keys that run your favorite programs. You'll probably
  4134. find that most of your programs run just fine -- except for other
  4135. telecommunications programs. Some of them will cause a conflict
  4136. with Flash over which one is controlling the modem port.
  4137.  
  4138. A function key that is set up to run a program should look like
  4139. this, if you set it up from a DO script:
  4140.  
  4141. >** setting up F4 to run STWriter...|
  4142. >fk 4 '>ex STWriter.prg|'|
  4143.  
  4144. Note that if the program you are running is not in the same
  4145. folder as Flash, you will have to do one of two things: Either
  4146. place the full pathname in the fkey command string, or change the
  4147. default directory to the program's directory before running it.
  4148. Some older GEM programs have resource files (files with a ".RSC"
  4149. extender) that won't be found unless you switch to the program's
  4150. folder first. Here are the two variations on the routine above,
  4151. with the second one needed to run some GEM programs:
  4152.  
  4153. >** setting up F4 to run STWriter...|
  4154. >fk 4 '>ex c:\stw\STWriter.prg|'|
  4155.  
  4156. >** setting up F4 to run STWriter...|
  4157. >fk 4 '>cd c:\stw\|>ex STWriter.prg|'|
  4158.  
  4159. After you run that command in a script, press F4 to run STWriter
  4160. within Flash. When you quit STWriter, Flash's familiar terminal
  4161. screen will reappear.
  4162.  
  4163. If you program and load function keys to run various programs,
  4164. you should be sure to save those function keys so that they are
  4165. available the next time you run Flash. You don't need to save
  4166. them as the default function keys; you can use another filename
  4167. and then load them by another function key. Here's an example on
  4168. how to do it from a DO file:
  4169.  
  4170. >** setting up fkeys and making an fkey loader.|
  4171. >sa fk funckey.def|>** saves current keys.|
  4172. >fk 1 '>fk|'|
  4173. >fk 2 '>cd c:\wp\|>ex wp.prg|'|
  4174. >fk 3 '>ex c:\icd\hdutils.prg|'|
  4175. ...
  4176. >fk 19 '>ex c:\qf.prg|'|
  4177. >fk 20 '>lo shellkey.def|'|
  4178. >sa fk shellkey.def|
  4179.  
  4180. Function key 1, in this example, is the Help key. When you press
  4181. it, all it does is show you a list of function keys and their
  4182. assignments -- a handy way of seeing all 20 at once.
  4183.  
  4184. Fkey 20 is the loader. Flash always boots up with the function
  4185. keys that are in the file funckey.def, but you can switch easily
  4186. to a new set of fkeys by using the F20 method above.
  4187.  
  4188. (In my own setup, I've gone a step further. F20 loads a set of
  4189. function keys that are themselves separate fkey loaders. This way
  4190. I am able to have as many separate function keys as I want, since
  4191. F20 in the first loader file could also load *another* set of
  4192. fkey loaders, and so on for the second and third set.)
  4193.  
  4194. You may also want to note that function keys can also include
  4195. comments, like this (in a script routine that sets up an fkey):
  4196.  
  4197. >fk 5 '>** shows general help file|>vi genhelp.txt|'|
  4198.  
  4199. And you might find it handy to create function keys that do
  4200. nothing by themselves -- in other words, fkeys that do not
  4201. operate unless you press <return> after you press the fkey. The
  4202. one I've used the most is an fkey that clears Flash's capture
  4203. buffer if I press <return>. if I press <undo>, it cancels out. It
  4204. uses the comment command to show a comment in Flash's
  4205. command-line window (the one at the bottom of the terminal
  4206. screen).
  4207.  
  4208. Here is how to load it from a script:
  4209.  
  4210. >fk 10 '>ca cl **<return> clears buffer; <undo> cancels'|
  4211.  
  4212. You'll note that function key 10 is not written "properly" --
  4213. that is, it does not end the way fkeys are supposed to end, with a
  4214. "|" character. As a result, when you press F10, the commands in
  4215. the function key are not executed. But if you press <return>, the
  4216. missing "|" is supplied and the commands are executed. Pressing
  4217. <undo> clears the command line and cancels the fkey.
  4218.  
  4219.  
  4220.  
  4221. Flash can do Zmodem easily
  4222. --------------------------
  4223.  
  4224.  
  4225. The "fact" that Flash can't do Zmodem is one of the biggest
  4226. fictions among the Flash lore. Because Flash does not have a
  4227. "Zmodem" entry in the GEM Upload and Download menus, some users
  4228. assume that there is no way to do Zmodem transfers within Flash.
  4229. But all Flash needs is a Zmodem module. The best is Alan
  4230. Hamilton's shareware program XYZ, which comes in both GEM and
  4231. non-GEM versions (xyz.prg and xyz.ttp). Both are available from
  4232. GEnie and other telecomm sources.
  4233.  
  4234. When you are ready to do a Zmodem transfer, simply issue a "gem
  4235. xyz" or "ex xyz" command. (You must use the "gem" command if you
  4236. want to run a GEM program and be able to use your mouse.)
  4237.  
  4238. I've found xyz.ttp much easier to use, since you can pass
  4239. commands and filenames to the program from a function key. After
  4240. you press the fkey, type the rest of the information on the Flash
  4241. command line and press <return>. Here's a sample fkey as it would
  4242. be set up from a script:
  4243.  
  4244. >** fkey 11 to receive Zmodem, fkey 12 to send.|
  4245. >fk 11 '>ex xyz -r|'|
  4246. >fk 12 '>ex xyz -s '|
  4247.  
  4248. Note that the command in fkey 12 does not end. When fkey 12 runs,
  4249. it waits for your input, which in this case would be the filename
  4250. or wildcards for whatever you want to upload.
  4251.  
  4252.  
  4253.  
  4254. Flash is a graphics program
  4255. ---------------------------
  4256.  
  4257.  
  4258. Can you see graphics without running another program within
  4259. Flash? You sure can. You can easily show a full-screen graphics
  4260. picture based on any Degas high-resolution or medium-resolution
  4261. picture. You do it by converting the Degas graphic to Vidtex, and
  4262. then using the "vi" (view) command in Flash. Flash's "vi" command
  4263. shows a text file on the screen, but if Flash is placed in its
  4264. Vidtex emulation mode (also "vi"), you'll see any Vidtex pictures
  4265. with the view command as well.
  4266.  
  4267. Included with this documentation is a copyrighted program,
  4268. VCONVERT.PRG, which converts pictures from Degas to Vidtex. The
  4269. program is freeware. Also with this documentation are a number of
  4270. Vidtex pictures that you can view with Flash/
  4271.  
  4272. To see Vidtex pictures, you should have the emulation mode set
  4273. to Vidtex. Here is a sample DO command line:
  4274.  
  4275. >mo vi|
  4276.  
  4277. To view them, use the other "vi" command. You can set up a
  4278. function key that needs your input to show the picture. Here's an
  4279. example:
  4280.  
  4281. >fk 7 '>vi |>** Type filename of Vidtex picture'|
  4282.  
  4283.  
  4284.  
  4285. Flash can automate your file backups
  4286. ------------------------------------
  4287.  
  4288.  
  4289. Backup programs are great, and they're an absolute necessity if
  4290. you don't want to lose what's on your hard drive. But between
  4291. backups, you can use Flash to automatically save your files in
  4292. archives (compressed files that may contain many standard
  4293. files). The actual archiving, of course, is done by a program such
  4294. as LHARC or ARC; what Flash does is execute the archiver at
  4295. specified times and under specific conditions. Flash's DO language
  4296. and its variables make this quite easy.
  4297.  
  4298. Here's how it's done.
  4299.  
  4300. First, this method of archiving takes advantage of one of the
  4301. lesser known commands in both LHARC and ARC, the "update" command.
  4302. Normally, the main functions of LHARC or ARC are the creation and
  4303. extraction of archives. The commands to do this are "a" (archive)
  4304. and "e" (extract).
  4305.  
  4306. But if you use LHARC or ARC for backing up files, the command
  4307. that may be most useful is "u" (update). The update command
  4308. forces LHARC and ARC to look at the time-and-date stamp that is
  4309. always placed on a file. Each time the file is changed in any
  4310. way, the ST/TT operating system updates that time/date stamp. By
  4311. checking all the files in an archive for the time/date stamp,
  4312. the "update" command knows which files in the archive need to be
  4313. updated.
  4314.  
  4315. In a neat additional feature, "update" also *adds* any files to
  4316. the archive that are not there already.
  4317.  
  4318. This gives you a simple way of maintaining a separate,
  4319. continually updated copy of your essential files, without needing
  4320. to do anything more than running a DO script. If you are in the
  4321. habit of running a master script every day, as I do, you need do
  4322. no more than add a line to the master script to execute the
  4323. backup DO file.
  4324.  
  4325. I use just such a method to keep a backup archive of the auto
  4326. folder on my C: drive, and I also use it to keep a backup
  4327. archive of all my DO files. (Because I enjoy programming DO
  4328. scripts, I usually write new ones or change current ones every
  4329. few days.)
  4330.  
  4331. Using LHARC or ARC to update archives does place one extra
  4332. requirement on your computer: You should have a built-in clock,
  4333. or, if that is not feasible, you must make sure you enter the
  4334. current time and date each time you boot your ST. (All STe
  4335. models, Megas and TTs have clocks built in.) You can change your
  4336. computer's clock from the Atari CONTROL.ACC, from the company's
  4337. CPX-based XCONTROL.ACC, or from many other desk accessories and
  4338. programs.
  4339.  
  4340. Since you already have a modem, my advice for those who do not
  4341. have a built-in hardware clock -- and those who want to make
  4342. sure the clock that they do have in their computer is accurate --
  4343. is to use CALLTIME, a program written by Bob Areddy, and available
  4344. (at the time this is being written) as CALLTIM3. You may be able
  4345. to find it on a local BBS, and should be able to download it from
  4346. GEnie. (It may be called CALLTIM3.ARC or CALLTIM3.LZH.)
  4347.  
  4348. CALLTIME uses your modem to dial the U.S. Navy Observatory near
  4349. Washington, D.C. and pick up the precise time from the
  4350. observatory's atomic clock. It automatically sets your computer's
  4351. internal clock and hangs up. A call should not cost more than 15
  4352. to 30 cents at night. (My calls average about 14 cents, at a
  4353. distance of about 400 miles from Washington.)
  4354.  
  4355. If your computer has a built-in hardware clock, CALLTIME will
  4356. reset it, and it will remain accurate even when you have rebooted
  4357. after the computer has been turned off. (Hardware clocks are
  4358. always running, even if the computer is off.) If you do not have
  4359. a hardware clock, your ST still has a software clock, and it will
  4360. be set accurately and should remain accurate to within a few
  4361. seconds a month as long as your ST remains on.
  4362.  
  4363. Here are the essential parts of two scripts for automatic file
  4364. backup. The first backs up all new and altered files in the
  4365. C:\auto\ folder, and the second backs up DO files.
  4366.  
  4367.  
  4368. >** This script must have a folder in the C: root|
  4369. >** named AUTOFBAK. It creates and maintains an archive|
  4370. >** called AUTOFLDR.LZH in that folder.|
  4371. >cd c:\auto\|
  4372. >$X d:\arc\|>** path of the archive program; use yours.|
  4373. >ex $Xlharc u c:\autofbak\autofldr *.*|
  4374. >pa 1|
  4375. >ty |
  4376. >ty Auto folder backed up successfully!|
  4377. >ty|>ty|
  4378.  
  4379.  
  4380. >** This script must have a folder in the Flash directory|
  4381. >** named DO, and a folder inside that folder|
  4382. >** named BACKUPDO. Change the "cd c:\flash" command to|
  4383. >** your drive and folder path for Flash.|
  4384. >cd c:\flash\|
  4385. >$X D:\arc\|>** see comment above.|
  4386. >$Y "do\backupdo\"|
  4387. >ex $Xlharc u $Xdofiles.lzh do\*.DO|
  4388. >ty |
  4389. >ty Do scripts backed up successfully!|
  4390. >ty|>ty|
  4391.  
  4392.  
  4393. ** A note about incompatible LHARC versions **
  4394.  
  4395.  
  4396. In the two examples above, the version of LHARC that is used is
  4397. the latest version of the so-called "Quester" LHARC, named for
  4398. Thomas Quester of Germany. Quester has done a lot to improve
  4399. LHARC, which was written by a Japanese programmer for IBM
  4400. compatible PCs. Quester's LHARC is almost fully compatible with
  4401. its current PC counterpart, now called LHA, but it is *not* fully
  4402. compatible with earlier versions of LHARC for the ST and TT. If,
  4403. as I do, you use the excellent desk accessory UNLZH to extract,
  4404. test or read the contents of LZH files, you should consider
  4405. using an additional command when you run LHARC from a DO file.
  4406.  
  4407. That command is actually a "switch" (an added instruction that
  4408. modifies a command), given as "-o" after the main command. The
  4409. "-o" switch forces LHARC to revert to an older compression
  4410. method that UNLZH accepts.
  4411.  
  4412. Here is how the command looks in a DO file line:
  4413.  
  4414. >ex $Xlharc u -o $Xdofiles.lzh do\*.DO|
  4415.  
  4416.  
  4417.  
  4418. Flash can maintain files by day and date
  4419. ----------------------------------------
  4420.  
  4421.  
  4422. If your computer has a built-in hardware clock, or if you make
  4423. sure you set your ST's time and date each time you boot up (see
  4424. the note about CALLTIME above if you want it done by modem), you
  4425. can use the script DATE.DO to set some of Flash's variables to
  4426. the current day and date. DATE.DO, which is distributed in the
  4427. archive with this documentation, gets its information about the
  4428. day and date from a freeware program named TIMEDATE (or TD in
  4429. some versions), also distributed in the archive. TIMEDATE creates
  4430. a data file, stored on disk, that DATE.DO reads to interpret the
  4431. data needed for Flash's variables.
  4432.  
  4433. In DATE.DO, variable A is the full date in the U.S. format
  4434. (August 3, 1993). Variable B is the full date in Canadian format
  4435. (3 August, 1993). Variable D is the day in one or two digits (3
  4436. or 22); variable M is the month, spelled out (August); variable
  4437. O is the month in two digits (08); variable W is the year in two 
  4438. digits; variable X is the year in four digits (1992), and
  4439. variable Y is the time that DATE.DO was run, using a European
  4440. version of the standard 24-hour format (14:42.15).
  4441.  
  4442.  
  4443.  
  4444. Flash can find its DO scripts and run them
  4445. ------------------------------------------
  4446.  
  4447.  
  4448. Some of you may be familiar with Procomm Plus, the most popular
  4449. telecommunications program for IBM-compatible PCs. One nicety
  4450. about PC Plus is the way it automatically executes its scripts
  4451. even if you don't type the filename extender. In other words, even
  4452. though PC Plus ASPECT scripts, the equivalent of Flash's DO files,
  4453. are supposed to named FILENAME.ASP, you can run them by giving
  4454. the FILENAME part of the name without the .ASP at the end.
  4455.  
  4456. Too bad Flash can't do that -- or can it? Yes, it can, with a
  4457. little help from you.
  4458.  
  4459. First, we are assuming that you will, in fact, want to give all
  4460. your scripts the .DO extender. This makes them easy to find and
  4461. easy to sort, and it also makes sure there is no doubt about
  4462. what they, um, "do" ... if you'll pardon the pun.
  4463.  
  4464. So the next step is to write a short script called "DO" -- yes,
  4465. that's the entire name, with no extender. It will be the *only*
  4466. script without an extender. We can get away with this, for one
  4467. DO file only, because this one will be the script that lets you
  4468. run the others without bothering with typing the ".DO" extender.
  4469.  
  4470. Here's the essential part of the script:
  4471.  
  4472.  
  4473. >** filename: DO
  4474.  
  4475. Tip: run this from a function key.
  4476.  
  4477. This script assumes that the DO files are located in the current
  4478. directory or in a folder named DO one level down in the current
  4479. directory.
  4480.  
  4481. |
  4482.  
  4483. >L: top|
  4484. >$Z .|
  4485. >op *.do|
  4486. >if op jmp getdoname|
  4487. >op do\*.do|
  4488. >if op jmp setc.d|
  4489. >** Do NOT take out the double quotes in the next line!|
  4490. >qu "Folder for DO files|(don''t type ""\""):" $Z|
  4491. >op $Z\*.do|
  4492. >if op jmp getdoname|
  4493. >if ~op al "[3][Folder not found!][Rats!|Quit]" $X 2|
  4494. >end|
  4495. >L: getdoname|
  4496. >cd $Z|
  4497. >qu "Execute which DO script?|(Type ""?"" for a list.)" $X|
  4498. >ifi $X "?" jmp listdo|
  4499. >op $X|
  4500. >if ~op jmp adddo|
  4501. >if op jmp doit|
  4502. >L: nofile|
  4503. >al "[3][File not found!|Try again?][Yes|No]" $X 1|
  4504. >ifi $X "Yes" jmp getdoname|
  4505. >end|
  4506. >L: adddo|
  4507. >$Y $X.do|
  4508. >$X $Y|
  4509. >op $X|
  4510. >if ~op jmp nofile|
  4511. >L: doit|
  4512. >do $X|
  4513. >end|
  4514. >L: listdo|
  4515. >dd *.do filelist.txt|
  4516. >vi filelist.txt|
  4517. >jmp getdoname|
  4518. >L: setc.d|
  4519. >$Z do\|
  4520. >jmp getdoname|
  4521. >** end|
  4522.  
  4523.  
  4524.  
  4525. <--== E N D ==-->
  4526.  
  4527.